Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
MALKITOM
Contributor II
Contributor II

Apply filter to multiple columns

Hello,

 

I have a issue with applying filter on chart sheet to multiple columns. 

More or less, I have following table when loading:

Col 1Col 2Col 3
ABC
CAB
CB 
AC 
BCA

 

And at the end I would like to have filter:

A
B
C

which would be able to apply to Col 1, Col 2, Col 3 (by OR operator). So whenever, value A was chosen from filter, rows that contains value A in Col 1 or Col 2 or Col 3 will be displayed. A,B,C are text (string) values. Is there any possibility to achieve what I want?

 

Regards,
Tom

2 Solutions

Accepted Solutions
marcus_sommer

Your data-structure is a crosstable which is rather seldom useful or beneficial in Qlik at least not within the UI because those multiple fields couldn't be selected/aggregated in a common way. Therefore I suggest to resolve this structure with The Crosstable Load - Qlik Community - 1468083.

- Marcus

View solution in original post

MALKITOM
Contributor II
Contributor II
Author

Hello,

 

It seems that I have manage to user Crosstable to achieve what I wanted to achieve. Thank you very much!

 

Regards,

Tom

View solution in original post

7 Replies
Or
MVP
MVP

Assuming your filter is a field named Filter, you would then write this into your formula, e.g.

Sum({< Col1=p(Filter) + Col2=p(Filter) + Col3=p(Filter) }> SomeOtherField)

MALKITOM
Contributor II
Contributor II
Author

Hello,

 

Will this also apply for sheet? I mean that I would like to have those A,B,C in filter pane (easy to do as to drag and drop required column from main table) and filter pane's selections should interacts on what is displayed in tables, charts other visualizations on same sheet.

Where then should I put this formula?

Or
MVP
MVP

This formula doesn't care where you made your selections - Smart Search, Selections screen, filter pane, click within an object... it just looks at the state of selections for your app.

This formula goes in your actual object (chart, table, or whatever else). Note that you may need something other than sum(SomeOtherFields), but the important part is the set analysis part encased by {< >} which should be copied into any aggregation functions (sum, count, only, etc) you want to work this way.

marcus_sommer

Your data-structure is a crosstable which is rather seldom useful or beneficial in Qlik at least not within the UI because those multiple fields couldn't be selected/aggregated in a common way. Therefore I suggest to resolve this structure with The Crosstable Load - Qlik Community - 1468083.

- Marcus

MALKITOM
Contributor II
Contributor II
Author

Hi,

 

I have tried to adjust this formula to my requirements but I am getting error: "Error in set modifier expression".

Count(DISTINCT {<[Col 1] = p(Filter) + [Col 2] = p(Filter) + [Col3] = p(Filter)>} ColumnToCount)

('Filter' is a name of the field from filter pane, filter values as created as the distinct values from table above)

Still, could explain me what 'p' stands for?

Regards,

Tom

Or
MVP
MVP

p() within set analysis stands for "possible" - that is, the possible values of the field Filter. If you've made a selection, this will be the selected vales. If you have not made a selection, this will be the white-background values (that is, the ones you can select). You may need to tweak the formula to make it work, I obviously couldn't test it without access to your data...

Marcus may be correct (see his comment) in that the issue may be with the underlying data structure, so that may be an avenue to pursue as well.

MALKITOM
Contributor II
Contributor II
Author

Hello,

 

It seems that I have manage to user Crosstable to achieve what I wanted to achieve. Thank you very much!

 

Regards,

Tom