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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Logical operators in set analysis

Hi all,

Can anyone explain me how the logical operators takes place in set analysis for below expression :

Count({$<DS={"Fail","Pass"}, LR={"Fail","Pass"}>} Distinct Lenskey)

i.e; which of the condition are correct for above set analysis

1.) Select Count (Distinct Lenskey) From table where DS ='Fail' or DS='Pass' or LR='Fail' or LR='Pass'

2.) Select Count (Distinct Lenskey) From table where DS ='Fail' and DS='Pass' and LR='Fail' and LR='Pass'

3.) Select Count (Distinct Lenskey) From table where (DS ='Fail' or DS='Pass') and (LR='Fail' or LR='Pass')

Thanks in advance

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Venkat

It is your:

     3.) Select Count (Distinct Lenskey) From table where (DS ='Fail' or DS='Pass') and (LR='Fail' or LR='Pass')


As in this bit means either Fail OR Pass

     {"Fail","Pass"}


and the comma in the middle seperate things as an AND

     {$<DS={"Fail","Pass"}, LR={"Fail","Pass"}>} Distinct



Best Regards,     Bill

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Venkat

It is your:

     3.) Select Count (Distinct Lenskey) From table where (DS ='Fail' or DS='Pass') and (LR='Fail' or LR='Pass')


As in this bit means either Fail OR Pass

     {"Fail","Pass"}


and the comma in the middle seperate things as an AND

     {$<DS={"Fail","Pass"}, LR={"Fail","Pass"}>} Distinct



Best Regards,     Bill

jchoucq
Partner - Creator III
Partner - Creator III

i will say Option 3

Regards.

Johann

Not applicable
Author

Thanks to all your suggestion.

Regards,

Venkat