O'Reilly logo

IBM Cognos 10 Report Studio Cookbook - Second Edition by Abhishek Sanghani, Ahmed Lashin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a token using macros

In this recipe, we will see how to dynamically change the field on which a filter is being applied to using a macro. We will use the prompt macro to generate one of the possible tokens and then use it in the query.

Getting ready

Create a list report based on native SQL similar to the previous recipe. We will use the same query that works on the product tables, but the filtering will be different. For that, define the SQL as follows:

SELECT DISTINCT "SLS_PRODUCT_LINE_LOOKUP"."PRODUCT_LINE_EN""PRODUCT_LINE" , "SLS_PRODUCT_LOOKUP"."PRODUCT_NAME" "PRODUCT_NAME" ,"SLS_PRODUCT_COLOR_LOOKUP"."PRODUCT_COLOR_EN" "PRODUCT_COLOR" ,"SLS_PRODUCT_SIZE_LOOKUP"."PRODUCT_SIZE_EN" "PRODUCT_SIZE"
FROM "GOSALESDW"."SLS_PRODUCT_DIM" "SLS_PRODUCT_DIM", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required