Defining dynamic default values for prompts

Suppose that we have a report which allows users to select a shipment month. In our data warehouse, the Time dimension (for shipment month) contains values up to the current month. However, the business owners frequently select the prior month, so they want the prompt to have the prior month selected by default.

Getting ready

Create a report that filters on the Shipment Month Key. Create a prompt page and add a value prompt for the Shipment Month Key.

How to do it...

To achieve the requirements of the business owner, we will write a JavaScript code that selects the second value from the top by default. In order to do this, perform the following steps:

  1. Open the prompt page in the report and select the value ...

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.