Cognos Analytics

 View Only
  • 1.  Data module alternative for parameter maps

    Posted Wed September 14, 2022 06:05 AM
    I saw some exiting new features in Data modules in the latest version of Cognos like alias and shortcut tables. Is there also an alternative for parameter maps? I really want this do perform filtering data in combination with macro functions like CSVIdentityName for autorisation.

    ------------------------------
    Thomas van der Meer
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: Data module alternative for parameter maps

    Posted Wed September 14, 2022 10:17 AM

    Hello Thomas,
    Parameter maps aren't yet supported in Data modules. The alternative is to use the macro function queryValue.

    queryValue ( value_expression [ , filter_expression [ , options ] ] )
    The options : a json literal object

    rowlimit : <n> an integer between 1 and 1,000 forced to 1
    autosummary : <boolean> true, false, 1 or 0 default false
    sort : <direction> ascending, descending or none default: ascending
    sortnulls : <placement> first or last default: last

    The result is not formatted, make sure to surround the call with sq ( ) as needed.
    Execute a query for a single column and return the value in the first (only) row.
    Example: # sq ( queryValue ( 'TheCalendar.TheWeekdayName' , 'TheCalendar.TheDate = 2018-06-06' ) ) #
    Result: 'Wednesday'

    There is also a macro function queryValues (plural), that returns multiple values.

    Starting with 11.2.2 it caches the values for the result for the duration of the planning of the current query. Thus multiple occurrences of the same queryValue arguments will lead to a single execution during the planning of a single query. 



    ------------------------------
    Kind regards,
    Henk Cazemier
    ------------------------------



  • 3.  RE: Data module alternative for parameter maps

    Posted Fri September 16, 2022 02:42 PM
    Thank you Henk. I also use this nice function in reports.

    But the advantage of using the CSVIdentityName with a parametermap is that it returns an unique list of values that is retrieved from the parametermap where each individual piece of the user's identity (account name, group names, rolenames) is used as a key into the map.

    Can this be achieved with the queryValue function where the content of the parametermap is in a table?

    ------------------------------
    Thomas van der Meer
    ------------------------------