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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rewrite Expression.


Hi,

I have expression below

if(status=amber,yellow,

if(status=red,red,

if(ststus=green,green)))

i just want to rewrite this expression using match() or any other function just to avoid multiple if condition. please advice.

Regards,

Piyush

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Pick( Match(status, 'amber', 'red', 'green') , 'yellow', 'red' , 'green')

Or,

If( status='amber', 'yellow' , status)

View solution in original post

6 Replies
tresesco
MVP
MVP

Pick( Match(status, 'amber', 'red', 'green') , 'yellow', 'red' , 'green')

Or,

If( status='amber', 'yellow' , status)

Not applicable
Author

Thanks Tresesco. i just want to know that pick expression really increases performance over multiple if conditions.

Regards,

Piyush

tresesco
MVP
MVP

Yes, pick-match combination is performance wise better than multiple IFs.

Not applicable
Author

Thanks for this valuable information.

Not applicable
Author

Hi tresesco,

Didn't get second expression if(status='Amber',yellow,status). could you please explain.

Regards,

Piyush.

Not applicable
Author

Hi Tresesco,

In the above expression as if(status=amber,amber,if(stautus=red,red,if(status=green,green))) but if want to insert else condition in it , then how will we deal with that in pick(match) function.

Regards

Piyush