The chart currently shows the number of Worked Hours, a measure that is selected in the radio button list on the left hand of the chart. When the user clicks another measure, the chart directly shows that measure, without further prompting.
In this post I will show how this has been developed.
Some notes first:
- This report is created in Cognos 8v4 BI, using Report Studio.
- The data source is a PowerCube, so some dimensional authoring is done in the report (using MUN's et cetera). This not relevant though, because I think the technique should also work with relational authoring.
First, create a Value Prompt object from the toolbox, and set it to:
- Required: "Yes"
- Multi-Select: "No"
- UI: "Radio button group"
- Auto-Submit: "Yes" (important, otherwise the report will not automatically be rerun):
In the Static Choices property of the Value Prompt object, enter the values to use (i.e. the measure MUN's) and to display in the radio button group:
In the Default Selections property of the Value Prompt object, enter the value to use when the report is run for the first time, so no prompt page appears:
So now the prompt object is finished.
Create a query item to refer to the prompt value
Next, the query used by the Chart object needs to contain an item that dynamically refers to the selected prompt value. Let's call this query item Q_Measure:
This item is defined in the query as a Data Item object, having these properties:
In general, this is a very powerful function you could use in many cases to create powerful reports. You are however limited to strings in the expression provided entirely by the macro function, because the macro function cannot be combined with other non-macro functions. See the Report Studio Professional Authoring User Guide for more information on macros and expressions.
Oh, and did you wonder what the link "Go to Analysis Report" was about in the report example above? Check out one of my next posts to come, about Contextual Analysis...