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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Multiple conditions in a field using IF clause

Hi

I have to check the following condition in my requirement

 

=Count( Distinct if( StageID =7 or StageID=8 or StageID=9 ,UserID))

Is there any way to handle the above condition like we do in sql : StageID in (7,8,9) in my IF condition.

1 Solution

Accepted Solutions
MayilVahanan

Hi


Try like this

= Count({<StageID = {7,8,9}>} Distinct UserID)

or

=Count( Distinct if( match(StageID,7,8,9) ,UserID))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

5 Replies
MayilVahanan

Hi


Try like this

= Count({<StageID = {7,8,9}>} Distinct UserID)

or

=Count( Distinct if( match(StageID,7,8,9) ,UserID))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
tresesco
MVP
MVP

Try match() function. In general multiple ORs should be better handled by match().

CELAMBARASAN
Partner - Champion
Partner - Champion

For this type of requirement you have to go with set analysis.

Count( {<StageID ={7,8 ,9}>} Distinct UserID)


Hope it helps

Celambarasan

Not applicable
Author

I want to use it in an expression is that possible?

Not applicable
Author

I have other conditions to check too.Without using set analysis is there any other option??