Author Topic: Applying different filters to multiple columns  (Read 160 times)

Offline Sunil Sharma

  • Associate
  • **
  • Join Date: Apr 2019
  • Posts: 1
  • Forum Citizenship: +0/-0
Applying different filters to multiple columns
« on: 15 Apr 2019 05:41:03 am »
Hi

I am fairly new to Cognos and am trying to organize data a certain way.

I was hoping somebody could help me with applying different filters to each column.

If you refer to the attachment for each column I would like to apply a separate filter. Currently when I add a filter (which is a search by word 'contains') it adds everything together.

For example in column 1 I would like it to contain all searches for contractors containing the word 'carpet' and for column 2 all contractors containing the word 'glass'. However what currently happens is when I add filters it searches for all contractors containing the word 'carpet' and 'glass' across all columns.

Hoping someone can let me know where I am going wrong.

Thanks.


Offline Corrigon

  • Full Member
  • ***
  • Join Date: Mar 2016
  • Posts: 34
  • Forum Citizenship: +0/-0
Re: Applying different filters to multiple columns
« Reply #1 on: 26 Apr 2019 12:22:24 am »
Hi - in your screenshot, you have 'Name1' twice as two different columns. Was this deliberate?
I'm a bit confused because in your post you refer to 'column 1' and 'column 2' - but it's the same data item?

When you say 'column1' and 'column 2' are you referring to 'Name1' and 'Name2'? I'm assuming you were.

Anyway, I think you need to use an OR clause in your filter.
Go to the Query View for your query (you have more control over how the filter works from this view)
Drag a Filter from the Toolbox into the Detail Filter pane.
Based on your screenshot, I would use something like this:

Code: [Select]
[Name1] contains 'carpet' OR [Name2] contains 'glass'
This will return all rows with 'carpet' in the Name1 column - regardless of what is in the 'Name2' column.
It will also return all rows with 'glass' in Name2 - regardless of what is in the 'name1' column.

is this what you are after?

 



       
Twittear