Adding Prompts to Filter Data

You can add prompts to a report to add interactivity for users. Prompts act as questions that help users to customize the information in a report to suit their own needs. For example, you create a prompt so that users can select a product type. Only products belonging to the selected product type are retrieved and shown in the report.

Prompts are composed of three interrelated components: parameters, prompt controls, and parameter values. Parameters are based on parameterized filters and form the questions to ask users. Prompt controls provide the user interface in which the questions are asked. Parameter values provide the answers to the questions.

IBM® Cognos® Report Studio provides several ways to create prompts. You can

If you include reports from different packages in an interactive dashboard that uses global filters, ensure that you use the same parameter name for the prompt in all the reports. For more information about creating interactive dashboards in IBM Cognos Connection, see the IBM Cognos Business Intelligence Administration and Security Guide.

You can also create prompts in the package. For more information, see the IBM Cognos Framework Manager User Guide.

You can also use context filters, also known as slicer filters, to focus the data in your report.

Syntax of Prompt Expressions

Prompt expressions use the following syntax, where p represents the parameter name.

You can also use these expressions to create parameterized data items that you can then use in master detail relationships.

The type of expression you use depends on whether you have chosen relational or dimensional reporting style. For more information about reporting styles, see Relational and dimensional reporting styles.

Relational: Detail Filter Expressions Dimensional: Context (Slicer) or Edge Expressions

[data item] = ?p?

for single-select prompts and master detail relationships

[level or hierarchy]->?p?

For single-select member prompts and master detail relationships

[data item] in ?p?

for multi-select prompts

set([level or hierarchy]->?p?)

For multi-select member prompts

filter ([set], [property expression] = ?p? )

For single-select value prompts and master detail relationships

A property expression is an expression that is assigned to a property to enable dynamic update of the property when the report runs.

filter ([set], [property expression] IN ?p? )

For multi-select value prompts

A property expression is an expression that is assigned to a property to enable dynamic update of the property when the report runs.