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: 
ioannagr
Creator III
Creator III

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
tresB
Champion III
Champion III

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
agigliotti
MVP
MVP

your expression looks good.

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

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
ioannagr
Creator III
Creator III
Author

43,7K 🤔

tresB
Champion III
Champion III

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])

mfarsln
Creator II
Creator II

Hi,

Try this;

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

 

ioannagr
Creator III
Creator III
Author

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?

agigliotti
MVP
MVP

for AND clause:

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

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
mfarsln
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])

 

ioannagr
Creator III
Creator III
Author

Thanks a bunch 🙂