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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
whiteside
Contributor III
Contributor III

Count expression with an OR funktion?

Hello Everyone,

This one really give me a headache.

I am trying to count actually IDs that have either "Attribute 1" X or y  OR "Attribute 2" X or y.

My current Syntax is this:

count({<[Attribute 1]={'X','y'},[Attribute 2] ={'X','y'}>} distinct ([ IDs ]))

     

and the Number that shown up is 743 (13+730).

I gues this makes sense from the Syntax.

But How am i suppose to rewrite it so i get 1280 (13 + 730 + 537) without mentioniong B in my syntax? I just want "Attribute 1" X or y  OR "Attribute 2" X or y.

best regards

whiteside

1 Solution

Accepted Solutions
joseph_eftamand
Partner - Creator
Partner - Creator

You can try splitting the 2 modifiers out, if you are trying to get the results for Attribute 1 = added to the results for  Attribute 2 = x,y.

count({<[Attribute 1]={'X','y'}> + <[Attribute 2] ={'X','y'}>} distinct ([ IDs ])).


Let me know if this works for you.

View solution in original post

3 Replies
joseph_eftamand
Partner - Creator
Partner - Creator

You can try splitting the 2 modifiers out, if you are trying to get the results for Attribute 1 = added to the results for  Attribute 2 = x,y.

count({<[Attribute 1]={'X','y'}> + <[Attribute 2] ={'X','y'}>} distinct ([ IDs ])).


Let me know if this works for you.

whiteside
Contributor III
Contributor III
Author

Excellent 😃 Thank you so much Joseph.

First i was confused because the number that was counted was 1498. But then i realized that i forgot to count 218 in my original question  😃

So this Syntax works perfect for me since it count everything i want without the B. So it is 1498 (13+730+537+218).

whiteside
Contributor III
Contributor III
Author

ingenious