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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

In and if/then Statements

Very basic question on how to use If/then statements..

I'm trying to use the below if/then statement and get allocated memory exceeded and I know it is because of my if/then and or statements, but I don't know how to do the equivalent of if([Event Family] in ('x','y','z'),[Event Family,'Other'), instead of resorted to "OR" statements within my if/then which only excacerbates my memory issue. Any suggestions? Thanks.

if([Event Family] = 'X' or [Event Family] = 'Y' or [Event Family] = 'Z', [Event Family],'Other')

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

See functions match, wildmatch, mixmatch. You can do the same. I can't tell anything about the memory usage.

View solution in original post

4 Replies
Anonymous
Not applicable
Author

See functions match, wildmatch, mixmatch. You can do the same. I can't tell anything about the memory usage.

Not applicable
Author

if(match([Event Family],'X','Y','Z')>0,'Other')

Not applicable
Author

The previous is wrong No

if(match([Event Family],'X','Y','Z')>0,[Event Family],'Other')

johnw
Champion III
Champion III

And since 0 is false and anything else is true, you don't need the >0:

if(match([Event Family],'X','Y','Z'),[Event Family],'Other')

And not that this was the question, but match is more than just a true/false. It returns an integer for the position of the first match, or 0 if nothing matched. That makes it useable for such things as this:

pick(match([Event Family],'X','Y','Z')+1,'Other','Andy X','Bob Y','Chad Z')