Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

whiteside
New Contributor II

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
Contributor

Re: Count expression with an OR funktion?

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.

3 Replies
joseph_eftamand
Contributor

Re: Count expression with an OR funktion?

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
New Contributor II

Re: Count expression with an OR funktion?

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
New Contributor II

Re: Count expression with an OR funktion?

ingenious

Community Browser