COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: gatorfe on 03 Apr 2012 01:26:46 PM

Title: Combination Filter?
Post by: gatorfe on 03 Apr 2012 01:26:46 PM
Hello, I have a report that list product code, facility, and warehouse.  I only want to see product codes that belong to specific combinations of facilty and warehouse.  For example for facility 10 I want to only see product codes in warehouse 1T,1A,1E, and 12.  I dont want to do this as a cascade prompt.  I want it to be a static filter in the report.  Any suggestions?  Thanks in advance!   
Title: Re: Combination Filter?
Post by: ArielFdez on 03 Apr 2012 02:20:55 PM
Are you using a multidimensional or a relational data base? Is facility a member or a measure?
Title: Re: Combination Filter?
Post by: bi4u2 on 03 Apr 2012 03:43:00 PM
You should be able to create a conditional filter in the report query to the effect of...

if facility=10 THEN Warehouse in (1T,1A,1E) else Warehouse in (X,Y,Z)
Title: Re: Combination Filter?
Post by: gatorfe on 03 Apr 2012 03:49:56 PM
I added the facility as an auto submit parameter on the prompt page and the warehouse parameter cascading back to the facilty on the prompt page.  I added this in the warehouse query as a filter but does not work.  Any other suggestions?
IF ( ?fac? = '10' ) THEN
    ( ?WHS? in ('1T', '1A', '1E', '10', '12') )
ELSE
    (?fac? = '17' ) THEN
( ?WHS? in ('17', '1S', '1B') )
Title: Re: Combination Filter?
Post by: blom0344 on 04 Apr 2012 02:19:07 AM
Why not:

((?fac? = '10')  AND    ?WHS? in ('1T', '1A', '1E', '10', '12') )
OR   
((?fac? = '17' ) AND  ?WHS? in ('17', '1S', '1B') )
Title: Re: Combination Filter?
Post by: Lynn on 04 Apr 2012 07:33:46 AM
I agree with blom's approach. The use if / case logic in filters is generally worth avoiding. Create boolean expressions that evaluate to true or false exactly as blom illustrated.
Title: Re: Combination Filter?
Post by: gatorfe on 04 Apr 2012 07:46:13 AM
ok, thanks everyone!
Title: Combination Filter?
Post by: MFGF on 04 Apr 2012 04:31:36 PM
Quote from: Lynn on 04 Apr 2012 07:33:46 AM
I agree with blom's approach. The use if / case logic in filters is generally worth avoiding. Create boolean expressions that evaluate to true or false exactly as blom illustrated.

Seconded! Blom's approach is the one I would adopt too.


Sent from my iPad using Tapatalk HD