Using the prompt() and promptmany() macros in query subjects

This recipe will show you that macros can be used with standard query subjects as well.

Getting ready

Create a simple list report based on the GO Sales Data Warehouse (Query) package. Insert Product line, Product, Product color, and Product size as the columns.

How to do it...

In this recipe you will see how to use macros as filters in Query Explorer as follows:

  1. Go to Query Explorer and open the query used by list.
  2. Add a detail filter with the following definition:
    [Product line] = #prompt('ProductLine')#
  3. Add another detail filter as follows:
    [Product] in #promptmany('Product')#
  4. Run the report to test it. You will see two mandatory prompts. The one for the Product line will let you enter one ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.