Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Uploads getting stuck in the virus scanner. We are investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

or in set analysis

Hello.

I have formed this expression 

 

Count( {<[reason is]={'this'}>+<[reason is]={'that'}>} distinct [row id])/ count([reason is])

 

and I get 0, while Count( {<[reason is]={'this'}>} distinct [row id])  alone is approx. 2000 

and so is Count( {<[reason is]={'that'}>} distinct [row id])    .

 

What could possibly be wrong?

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

If you put values for a field separated by comma, they are OR by default in set analysis. Therefore, you could simply try like:

Count( {<[reason is]={'this', 'that'}>} distinct [row id])/ count([reason is])

View solution in original post

8 Replies
Highlighted
Partner
Partner

your expression looks good.

what you get  for  the expression =count([reason is]) ?

Highlighted
Creator II
Creator II

43,7K 🤔

Highlighted
MVP
MVP

If you put values for a field separated by comma, they are OR by default in set analysis. Therefore, you could simply try like:

Count( {<[reason is]={'this', 'that'}>} distinct [row id])/ count([reason is])

View solution in original post

Highlighted
Creator II
Creator II

Hi,

Try this;

Count( {<[reason is]={"this","that"}>} distinct [row id])/ count([reason is])

 

Highlighted
Creator II
Creator II

Thanks guys!

 

What would it be if I wanted the "and" clause?

 

PS: It's strange how  in one app for "or" the plus sign works (i've done this before) and for this one it doesn't. Why is that?

Highlighted
Partner
Partner

for AND clause:

Count( {<[reason is]={'this'}> * <[reason is]={'that'}>} distinct [row id])/ count([reason is])

Highlighted
Creator II
Creator II

Hi,

For the 'and' clause;

Count( {<[reason is]={'this'},[another_field]={'something'}>} distinct [row id])/ count([reason is])

or

Count( {<[reason is]={'this'}>*<[another_field]={'something'}>} distinct [row id])/ count([reason is])

 

Highlighted
Creator II
Creator II

Thanks a bunch 🙂