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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
divianjani
Contributor II
Contributor II

How to use OR operator in Set Analysis

Hi Everyone,

I need urgent help...

i have an expression by using IF condition along with And OR operators..

Now i want to write same expression by using set analysis without using IF condition...

Original Exp:

sum(if((match(Coulmn1,01,02,03,04,05,06) and Column2 = 'Dis' or Column2 = 'Com')

and match(Column3,7,8) and OG <> ' ' and TSIT = 'Sales',Units))

So i have tried by using set analysis like below.

sum({<Coulmn1={'01','02','03','04','05','06'}, Column2 = {'Dis','Com'},Column3={7,8},OG-={' '},TSTI ={'Sales'}>} Units )

So, when i have applied this in the report values are  not matching with earlier one, Can any one help me out...

Thanks in Advance

4 Replies
sunny_talwar

Are you sure this is the correct original expression?

sum(if((match(Coulmn1,01,02,03,04,05,06) and Column2 = 'Dis' or Column2 = 'Com')

and match(Column3,7,8) and OG <> ' ' and TSIT = 'Sales',Units))

May be you want this

sum(if((match(Coulmn1,01,02,03,04,05,06) and (Column2 = 'Dis' or Column2 = 'Com'))

and match(Column3,7,8) and OG <> ' ' and TSIT = 'Sales',Units))

Because if your original expression was correct, then the set analysis will probably need to change because it is saying

Condition 1 is true

match(Coulmn1,01,02,03,04,05,06) and Column2 = 'Dis'

or

Condition 2 is true

Column2 = 'Com'

Is that what it really is?

sunny_talwar

You can try this, if your original expression is right

Sum({<Coulmn1 = {'01','02','03','04','05','06'}, Column2 = {'Dis'}, Column3 = {7,8}, OG -= {' '}, TSTI = {'Sales'}>+

<Column2 = {'Com'}, Column3 = {7,8}, OG -= {' '}, TSTI = {'Sales'}>} Units)

divianjani
Contributor II
Contributor II
Author

Thanks for your response sunny..

Yes that is original expression...

i will try with above one.

divianjani
Contributor II
Contributor II
Author

Thank you so much sunny

It is working fine values are matching....