COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: juffin on 17 Oct 2013 02:21:43 PM

Title: Cognos Textbox/Value prompt with alternate value
Post by: juffin on 17 Oct 2013 02:21:43 PM
Hi,
I'm new to Cognos.  I have a value prompt page which displays two values - Male,Female
But in back end they are stored as 0,1 respectively. But when user selects Male the report should fetch all the records with value 0
and viceversa. Any idea how this can be done?
Thanks in adv
Jf
Title: Re: Cognos Textbox/Value prompt with alternate value
Post by: calson33 on 17 Oct 2013 02:32:54 PM
When you create a prompt, you have a "Use Value" and "Display Value" (see properties of the prompt)
Your display values should be "Male" and "Female", while the use values should be 0 and 1.
Title: Re: Cognos Textbox/Value prompt with alternate value
Post by: juffin on 17 Oct 2013 02:50:11 PM
Thanks Calson that's working for Value prompt, but if it's a text box prompt if user types 'Male' how will it fetch data for value 0 in backend.
Title: Re: Cognos Textbox/Value prompt with alternate value
Post by: bdbits on 17 Oct 2013 03:45:54 PM
You're going to ask them to type in a choice? Well, ok, you would inspect the value in your filter expression, probably force to upper or lower case and use an if statement. And what are you going to do if they enter an invalid value?

Why would you do that? Just use a value prompt; no ambiguity. It's better for you, it's better for the user. Win-win.