COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: msooria on 09 May 2011 03:01:09 PM

Title: Changing the subsequent prompts depending on the previous prompt value
Post by: msooria on 09 May 2011 03:01:09 PM
Hi

I'm trying to change the display of prompts based on the value chosen for the previous prompt;

i.e. If I choose Male for the first prompt, the next prompts should be Height & Weight, when I choose Female then it should show Color and Size.

Thanks for your help in advance.
Title: Re: Changing the subsequent prompts depending on the previous prompt value
Post by: leahmarie on 09 May 2011 03:20:13 PM
Is it in a cube in a heirarchy? Because if it is you should just be able to change the cascade source in the properties box of the prompt.
Title: Re: Changing the subsequent prompts depending on the previous prompt value
Post by: Tsunami on 09 May 2011 03:41:02 PM
Not sure if this is the best way, but it's worked for me.

After creating your male/female prompt (set autosubmit to 'yes'), create both options below it.  Then select all the male options (height/weight and any text) and create a render variable that displays when 'Male' is selected.  Do the same for 'Female'.
Title: Re: Changing the subsequent prompts depending on the previous prompt value
Post by: msooria on 10 May 2011 08:57:12 AM
Tsunami,

I tried your valuable suggestion to the prompt "Height" to add a render variable, but it does not show me anything related to the Gender (M/F) prompt. Am I doing something differently?

Thanks.
Title: Re: Changing the subsequent prompts depending on the previous prompt value
Post by: Arsenal on 10 May 2011 01:33:14 PM
if the second level prompt values are coming from a table that has values (via keys, for example) for the first level prompt then a simple cascading prompt (set cascade source of second prompt to the first prompt's variable and set the first prompt to auto submit) should suffice.

If your prompts are static choice prompts, then create the male/female prompt, create a string variable (use ParamValue) and set it's options to the use values of the male/female prompt, then use this variable as render variable for the second prompts including all text and html fields for that prompt - you will create two prompts which will have static choices of Height and Weight and the second one will have Color and Size as static choices. Set each of these prompts to render appropriately for the variable created earlier, i.e. height and weight prompt will render for string variable value = 'Male' and color and size prompt will render for string variable value = 'Female'