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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Are there any function like switch case?

Hi,

I was wondering whether there are some function like switch case.

Allow me to take an example:

In the expression: I can use If clause to judge, but it is limited to 2 choices, but I want to get more than 2 choices.

Thanks.

1 Solution

Accepted Solutions
Not applicable
Author

Hi Isaac,

Check if below code helps you.

pick(wildmatch(Year,2000, 2001,2002,'*'),'A', 'B', 'C', 'Other')

- Sridhar

View solution in original post

3 Replies
deepakk
Partner - Specialist III
Partner - Specialist III

hi,

You can use the Match function to achieve the same

eg:

if(match( Year, 2000,2001,2002)>0,1)

I hope this helps.

Not applicable
Author

I mean, I want this one:

If year=2000 then A , year=2001 then B, year=2002 then C.

How to do?

Not applicable
Author

Hi Isaac,

Check if below code helps you.

pick(wildmatch(Year,2000, 2001,2002,'*'),'A', 'B', 'C', 'Other')

- Sridhar