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:


Get IBM Cognos 10 Report Studio Cookbook - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.