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

Announcements
We are aware of an issue with the Product Downloads page and looking into it.
cancel
Showing results for 
Search instead for 
Did you mean: 
SerSwagster
Creator
Creator

Multiple Nested if

Hi everyone.

I have these separate script lines.

if(Left(Name, 3) = 'Mar' and WildMatch(Color,'*yellow*'), if(NOT wildmatch(Color,'*green*','*red*'), 'check', 'ok'))

if(Left(Name, 3) = 'Mat' and WildMatch(Color,'*red*'), if(NOT wildmatch(Color,'*blue*','*orange*'), 'check', 'ok'))

if(Left(Name, 3) = 'Mar' and WildMatch(Color,'*green*'), if(NOT wildmatch(Color,'*purple*','*brown*'), 'check', 'ok'))

I want to unify them in a unique script line, i.e. if at least one of this condition is verified, i have 'check' back.

How can I implement it?

1 Reply
vikasmahajan
MVP
MVP

hi,

Instead of nested if's use pick match  function which is effective in terms of performance you can use following example to build your expression

https://community.qlik.com/t5/New-to-Qlik-Sense/pick-match-function/m-p/1817379#M187107

https://community.qlik.com/t5/New-to-Qlik-Sense/Nested-ifs-vs-pick-match/td-p/1606446

thanks

Vikas

 

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.