Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis "or" and "and" operators

Hi,

can we write below expression in set analysis?

count(distinct if(((Test_Family= 'abc' or Test_Family = 'abcd') and High_Risk = 'Yes'), A_ID))

Thanks in Advance.

Thanks,

Rohini

1 Solution

Accepted Solutions
sunny_talwar

May be this:

Count(DISTINCT {<Test_Family = {'abc', 'abcd'}, High_Risk = {'Yes'}>} A_ID)

View solution in original post

10 Replies
sunny_talwar

May be this:

Count(DISTINCT {<Test_Family = {'abc', 'abcd'}, High_Risk = {'Yes'}>} A_ID)

Not applicable
Author

It worked Sunny.

Thank you

Not applicable
Author

Hi Sunny,

When I add another condition for the same expression its not working. Can you help me with this.

Count(DISTINCT {$<Test_Family_2 = {'NIPT', 'NIPTMD'}, High_Risk_NIPT = {'Yes'}, Adjudicated = {1}>} Accession_ID)

Thanks,

Rohini. M

sunny_talwar

I don't see anything wrong here. What is the error that you are seeing?

Not applicable
Author

I got decreased count

swuehl
MVP
MVP

Isn't this what is expected? I mean, by adding another AND condition to the set analysis?

At most you would get the same count as before, but not more, right?

Not applicable
Author

Yes Stefan.

But I have same condition written in if condition and am comparing set expression results to the regular if condition results.

But now I checked with same and I got correct results. May be I mistaken with some other logic.

Thank you

sunny_talwar

So is this all resolved now?

Not applicable
Author

Yes sunny. Thank you