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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Simply syntax question

I want to do the equivalent, in a calculated dimension, of a SQL IN statement.

Specifically, I only want to show rows where the UserID is the SalesRep or one of the sales assistants, so I want the condition to read:

if(UserID=SalesRep OR UserID IN ('John','Mary','Ted'),UserID,Null())

But QV doesn't have an "IN" function that I could find, and I don't want to type out four different OR conditions. Surely this exists! I've been through the documentation, and with its terrible search function, can't find anything that tells me how to do this.

Can someone please help?

Thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

try using match: if(UserID=SalesRep OR match(UserID,'John','Mary','Ted'),UserID,Null())


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

try using match: if(UserID=SalesRep OR match(UserID,'John','Mary','Ted'),UserID,Null())


talk is cheap, supply exceeds demand
MayilVahanan

HI

Try with match() function

Like this

if(Match(UserID, 'John','Mary','Ted'),UserID,Null())

Hope it helps

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

Thanks, that worked fine.

Not applicable
Author

Thanks Mayil, Gysbert beat you to it!

CELAMBARASAN
Partner - Champion
Partner - Champion

Match itself does OR operation . so simply it also works

if(match(UserID,SalesRep,'John','Mary','Ted'),UserID,Null())

Hope it helps

Celambarasan