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

How to Optimize and remove if statement

=if(WildMatch(UrgencyID,'*CRITICAL -*') and ([Close Date]-[Open Date])=0 ,'Under SLA',

if(WildMatch(UrgencyID,'*HIGH*') and ([Close Date]-[Open Date])>=1,'SLA LOW Priority',

if(WildMatch(UrgencyID,'*MEDIUM*') and ([Close Date]-[Open Date])>=3 ,'SLA MEDIUM PRIORITY',

if(WildMatch(UrgencyID,'*LOW*') and ([Close Date]-[Open Date])>=5 ,'SLA HIGH PRIORITY'

'SLA MISSED'))))

in above script i want to remove if and optimize using other mean (eg. set analysis).

Thanx.

Message was edited by: rahul b

3 Replies
sujeetsingh
Master III
Master III

Rahul,

one thing you can do is that you can calculate these condition in your script as flag

For example

You can calculate  ([Close Date]-[Open Date]) in script and name it as DateDiff.

And then in UI you can use this Flag in your expression if possible you can go in the same way for the other caonditions too

Not applicable
Author

thanx

maxgro
MVP
MVP

best optimization is almost always put the logic at the script level