Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

filtering data based on 'or' of multiple fields

I am interested in all rows that have either field1=value1 OR field2=value2.

I know how to filter rows with selection trigger where field1=value1 OR field1=value2. But note that this is not what i want. I want to base the selection of 2 separate fields.

How do i achieve this?

6 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this

=Sum({<field={'value1'}> + <field2={'value2'}>}  Sales)

Regards,

Jagan.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

you can use Set analysis union operator to do this

Example Sum({<field1={"value1"}, field2={"value2"}>} Field3) for "AND" operation

Sum({<field1={"value1"}> + <field2={"value2"}>} Field3) for "OR" operation

Celambarasan

Not applicable
Author

Thanks Jagan and Celambarasan.

However, i am not looking to aggregate or sum anything. I simply want to filter the data set.

So, for example, the data set has 3 fields: Project ID, Cost Center, Manager

I want to see all Project ID's that are either in Cost Center 100 or are managed by John Smith.

How do i do this?

sbaldwin
Partner - Creator III
Partner - Creator III

Hi I agree with the other posts to do this with the selections is not a very good idea you need to load every cominbination into a new table X2, in this example for 26 diverent values in the field (Alpha) to create two new fields that will provide an OR selection in this field (AlphaA and AlphaB ) i needed to create a table with 1352 values! attached is the example.

Anonymous
Not applicable
Author

Hi,

  it is not possible to calculate value based on two dimension in set analysis,

for that purpose you want to use if clasuse only.

write a if statement like....................

  

    =sum( if(Filed1=Value1 or filed2=Value2,QTY))

Regards

Not applicable
Author

I have 30 such fields

I don't mind not using selection. But, is there ANY way to do this very reasonable task?