COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: jdmas on 25 Mar 2015 10:55:22 AM

Title: Multiple Filters in one column
Post by: jdmas on 25 Mar 2015 10:55:22 AM
Hey everyone,

So I am trying to filter a column that has multiple "parameters". For example, I am trying to filter for multiple products (Product A, Product B, and Product C)

I am able to filter one at a time, but cannot figure out how to apply all three criteria to one column.

Any assistance will be great!
Title: Re: Multiple Filters in one column
Post by: kc9400 on 25 Mar 2015 11:01:07 AM
Are the 'products' A, B, C in one of the prompts?

If so are you using an '=' if so you'll need to use an 'IN'

Obviously this all depends on the setup etc..... but this is a starting point. Also on the prompt you should have the option to set it to multi-select.

Hope this helps.
Title: Re: Multiple Filters in one column
Post by: jdmas on 26 Mar 2015 10:47:58 AM
I'm not sure I am following. Probably because I wrote the question out confusing. haha

Products is one of the available components I can use to build a report. There are many products, but I need a report that just shows A, B, and C. When I add a filter for the products individually, the report runs. However, when I try and filter for all three, the report comes out blank.
Title: Re: Multiple Filters in one column
Post by: MFGF on 27 Mar 2015 05:21:27 AM
Quote from: jdmas on 26 Mar 2015 10:47:58 AM
I'm not sure I am following. Probably because I wrote the question out confusing. haha

Products is one of the available components I can use to build a report. There are many products, but I need a report that just shows A, B, and C. When I add a filter for the products individually, the report runs. However, when I try and filter for all three, the report comes out blank.

What expression are you using in your filter?

I think what kc9400 was suggesting is that the expression use an 'in' operator rather than an '=' operator

eg

[Your Product item] in ('Product A', 'Product B', 'Product C')

Cheers!

MF.
Title: Re: Multiple Filters in one column
Post by: Michael75 on 27 Mar 2015 11:16:32 AM
@ jdmas

I may be mistaken, but from your chosen subject line, I got the impression that you were trying to select all three values 'Product A', 'Product B' & 'Product C' by applying three filters to your query.

The solution is indeed to use the syntax suggested by MF, in a single filter. The points brought up by kc9400 are relevant too.