COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: dferrara on 06 Jun 2010 10:08:30 AM

Title: Conditional Filter
Post by: dferrara on 06 Jun 2010 10:08:30 AM
I would like to conditionally control a filter in a report in report studio. Is there away that I can mark a filter optional and then based on a conditional statement determine if the filter will be used or now?

In my case I would like to use the filter based on what the current session group is. If it is group A enable the filter else disable the filter.
Thanks for your help.
Title: Re: Conditional Filter
Post by: tupac_rd on 08 Jun 2010 11:37:31 AM
I think you can add the group level condition in your filter itself.
Title: Re: Conditional Filter
Post by: dferrara on 10 Jun 2010 08:09:12 PM
I would be intersted in hear more how to do this.
Title: Re: Conditional Filter
Post by: tupac_rd on 11 Jun 2010 08:28:47 AM
I am assuming this is for a Report studio report.

add a query calculation in the report query called "Group Name" with the following expression #sq(csv(CAMIDListForType('group')))#

Then your filter would include

if ([Group Name] = 'Group A') then (1=1) else ([Data Item] = ?prompt?)

instead of just

[Data Item] = ?prompt? which I guess you have right now.

HTH
2pac
Title: Re: Conditional Filter
Post by: dferrara on 22 Jul 2010 08:33:15 AM
Great! thanks