Hello everyone,
I was wondering if its possible (in Cognos 8.2) to build a chart report that would enable the user to select the measure fields from a dropdown box?
Currently I have three line charts where each has two measures in the "Series" box. I would like to set up a single line chart report with a dropdown box with three choices to select from. Each selection needs to have two measures in the Series box though.
Any help or advice will be greatly appreciated.
It is possible.
Create a data item, called Measure, with the following function:
#prompt('pMeasure','token','defaultmeasure')#
The default measure should be the measure from the insertible field list. [NS].[Measure].[Sales] for example.
Place that data item into the chart as needed.
Create a value prompt with static values, remember to set autoprompt or to add a reprompt button.
Display | Use
-----------+------------------------
Sales |[NS].[Measure].[Sales]
Revenue |[NS].[Measure].[Revenue]
Profit |[NS].[Measure].[Profit]
When the user selects a measure Cognos will place the use value into the data item, just as if you put it there originally.
I have given a basic description of token prompts here: http://www.cognoise.com/community/index.php/topic,9015.0.html (http://www.cognoise.com/community/index.php/topic,9015.0.html)
Thank you for taking the time to help me out Paul.
I've resolved this problem using conditional formatting with a conditional block. A problem I encountered is with the Use and Display names. If i set a more user friendly name for the Display, the report only runs the default chart. If i set the same names for both Use and Display then the report displays the chart selected in prompt. Your solution sounds more interesting and quicker. I will give your suggestion a try first thing in the morning.
Thank you again.
Shaam
QuoteI've resolved this problem using conditional formatting with a conditional block. A problem I encountered is with the Use and Display names. If i set a more user friendly name for the Display, the report only runs the default chart. If i set the same names for both Use and Display then the report displays the chart selected in prompt.
I suppose this is because of the condition you have specified for the conditional block. Check the expression for the associated condition variable, whether it uses ParameterDisplayValue() or ParameterValue(). Both are different as their name suggests and uses the Display/Use values of the prompts respectively.
Awesome tip Paddhu. That did resolve my problem. Thanks so much for your help. :D
You can also use this with a map.
With a map? :-\
If you are doing a report that uses a map instead of a chart you can use this same prompt soultion to apply different measures to the map.
Thats good to know Jim. Thank you. :)
I will keep that in mind when I get a requirement for a report with map. And if I get stuck, i know who to bug. ;)
Dear PaulM,
For some reason your approach doesn't work for me. I am using Cognos 8.4. My default measure displays the item information, but not the value.
Example: Masure item contains [NS].[Measure].[Sales], not the actual sales numbers.
Any ideas?