COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: chinnucognos on 16 Dec 2013 07:31:25 AM

Title: check box in prompt page
Post by: chinnucognos on 16 Dec 2013 07:31:25 AM
Hi all,
i have a requirement that two calculations(data items) need to display in prompt page.
I have used value prompt with static choices as two data items with conditional varibles taken.
For eg: 1.error rate%
             2.Success rate %
              3.Both.
static choices as error rate% and success rate % in value prompt.
Now the issue is user wants to display above two in check, i hav changed this in 'check box' with multi select 'yes',
but still after running it is displaying in radio buttons
Title: Re: check box in prompt page
Post by: Lynn on 16 Dec 2013 08:52:04 AM
How are you applying the parameter? If you have, for example, a filter that says [DataItem] = ?MyParam? then the prompt will always be treated as a single rather than multi select. The filter would need to be changed to use "in" instead of "=" in order for the corresponding prompt control to render as a multi select prompt.
Title: Re: check box in prompt page
Post by: chinnucognos on 16 Dec 2013 09:13:18 AM
i Have used sting variable with case statement as

case when (ParamDisplayValue('Graph1') = 'Error Rate {%}')
then 'Error Rate {%}'
when (ParamDisplayValue('Graph1') = 'success  Rate {%}')
then 'success Rate {%}'
else 'Both'
end
Title: Re: check box in prompt page
Post by: Lynn on 16 Dec 2013 09:17:09 AM
Well then, there's your problem!

Perhaps using "contains" rather than "=" will solve it.
Title: Re: check box in prompt page
Post by: chinnucognos on 16 Dec 2013 09:33:59 AM
tried it....still same problem persists :'(
Title: Re: check box in prompt page
Post by: Lynn on 16 Dec 2013 09:55:34 AM
Sounds like you are referencing the parameter elsewhere in a single select sort of way. Try doing a search for expression text and maybe you'll find another reference to it. Attached is a report from the Cognos samples that uses a string variable with "contains" and renders a multi-select check box.

Also, I don't think your case logic (even with contains) is going to work as you expect. First of all, it doesn't really make sense to offer a static choice of "both" when you convert to a multi-select. What if the user selects error rate %, success rate %, AND the both option? It is just confusing for the user and it complicates your logic.

My sample uses logic below:

case
when ParamDisplayValue('SelectMetric') contains 'Quantity'
  and ParamDisplayValue('SelectMetric') contains 'Revenue'
then 'Both'
when ParamDisplayValue('SelectMetric') contains 'Quantity'
then 'Quantity'
when ParamDisplayValue('SelectMetric') contains 'Revenue'
then 'Revenue'
end