COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: sameena on 10 Apr 2014 02:19:47 AM

Title: pass multiple values from a prompt
Post by: sameena on 10 Apr 2014 02:19:47 AM
Hi all,
I have a sql based report that has a column named 'id' that has values like A, B, C

i need to create a prompt that displays
1
2

When the usedr selects 1 then data with respect to A should be displayed
When the user selects 2 then data with respect to B and C should be displayed.

I used a case satement in my column but its not working fine

Thanks,
Sam
Title: Re: pass multiple values from a prompt
Post by: MFGF on 10 Apr 2014 03:10:52 AM
Quote from: Sam85 on 10 Apr 2014 02:19:47 AM
I used a case satement in my column but its not working fine

Hi,

Can you share the expression you are attempting to use? It's difficult to know what the issue might be unless we see what you have done already.

How are you populating the prompt? Are you using Static Choices? If so, what have you defined as the "Use Value" for each?

MF.
Title: Re: pass multiple values from a prompt
Post by: sameena on 10 Apr 2014 04:00:09 AM
I have a [desc] column that has three values. Normal, distributed and redistributed
the desc column comes from a sql.  i created a parameter ?wave?. I used static choice - use values as 1 and 2.

I used the below filter expression
if ((?desc?) = 1) then

([SQL1].[DESC]) = ( 'Normal))

else if ((?wave?) = 2) then ([SQL1].[DESC] in  ('Distributed','Redistributed'))

else ([SQL1].[DESC] in (?wave?))


please correct me if the above expression is wrong.


Thanks,
Sam


Title: Re: pass multiple values from a prompt
Post by: MFGF on 10 Apr 2014 04:32:09 AM
Quote from: Sam85 on 10 Apr 2014 04:00:09 AM
I have a [desc] column that has three values. Normal, distributed and redistributed
the desc column comes from a sql.  i created a parameter ?wave?. I used static choice - use values as 1 and 2.

I used the below filter expression
if ((?desc?) = 1) then

([SQL1].[DESC]) = ( 'Normal))

else if ((?wave?) = 2) then ([SQL1].[DESC] in  ('Distributed','Redistributed'))

else ([SQL1].[DESC] in (?wave?))


please correct me if the above expression is wrong.


Thanks,
Sam

How about:

(?wave? = 1 and [DESC] in ('Normal')) or (?wave? = 2 and [DESC] in ('Distributed', 'Redistributed'))

MF.
Title: Re: pass multiple values from a prompt
Post by: sameena on 12 Apr 2014 06:11:03 AM
Thanks MFGF, I applied your logic and it did the trick...

Regards,
Sam