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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Something similar to in() function?

Hello,

Is there any function that I can use to check whether the contents of a variable is in a given list?

Example: If Fruit In("apple","orange","kiwi") then ...

Thanks.

1 Solution

Accepted Solutions
jolivares
Specialist
Specialist

Try Match() function.

If(Match(Fruit,'apple','orange',kiwi')>0,true,false)...

View solution in original post

2 Replies
jolivares
Specialist
Specialist

Try Match() function.

If(Match(Fruit,'apple','orange',kiwi')>0,true,false)...

stephencredmond
Partner - Specialist II
Partner - Specialist II

Just FYI, if you are using a function like Match (or MixMatch or WildMatch) which returns a number representing the position in the list that the item is found, you can get away with the ">0" in the condition.  The function returns 0 if the item is not found in the list which QlikView interprets as "False".  Anything else, other than 0, is "True" (doesn't have to be just -1).

Might save you a second or two 😉

Stephen