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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

To write IF statement in load script

I try the IF statement

if ("L_Point"='3','Late stage') and

if ("L_Point"='6','Mid stage') and

if ("L_Point"='9','Early stage')

but it's not work?! why? what the correct IF statement?

Q1_1.jpg

1 Solution

Accepted Solutions
Vegar
MVP
MVP

https://help.qlik.com/en-US/sense/3.0/Subsystems/Hub/Content/Scripting/ConditionalFunctions/if.htm

Try:

if ("L_Point"='3','Late stage',

   if ("L_Point"='6','Mid stage', 

      if ("L_Point"='9','Early stage')))

View solution in original post

3 Replies
Vegar
MVP
MVP

https://help.qlik.com/en-US/sense/3.0/Subsystems/Hub/Content/Scripting/ConditionalFunctions/if.htm

Try:

if ("L_Point"='3','Late stage',

   if ("L_Point"='6','Mid stage', 

      if ("L_Point"='9','Early stage')))

Anonymous
Not applicable
Author

Try

if(L_Point='3','Late stage', if(L_Point='6','Mid stage', if(L_Point='9','Early stage')))

This doesn't dictate what to do if the L_Point isn't 3, 6 or 9 so I am assuming it can't be any other number. If it can you will want to add something to the expression for example:

if(L_Point='3','Late stage', if(L_Point='6','Mid stage', if(L_Point='9','Early stage', Null())))

or

if(L_Point='3','Late stage', if(L_Point='6','Mid stage', if(L_Point='9','Early stage', L_Point)))

maxgro
MVP
MVP

pick(match(L_Point,      '3',' '6', '9'),

                                   'Late stage', 'Mid stage', 'Early stage')