Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
derekrobertson2
Contributor II
Contributor II

Multiple If statements in Qlik Sense load script

I'm tyring to add multiple if statements in my Qlik Sense load script.

The data has a status that I would like to group into 4 different stages and then call that Open Position Stage

If ([Status] <> 'Withdrawn' or [Status] <> 'Rejected', 'Open Positions',

    If ([Status] <> 'Withdrawn' or [Status] <> 'Rejected' or [Status] <> 'Submitted' or [Status] <> 'Halted', 'Pending Approval',

    If ([Status] = 'Submitted', 'In Process',

    If ([Status] = 'Halted', 'Onboarding')))) AS "Open Position Stage",

So, in the end I would like to have Open Position Stage as a dimension with values of Open Positions, Pending Approval, In Process, and Onboarding.

I'm struggling with the syntax and have tried several different things, but can't get it to load properly.

Anyone know what I'm doing wrong here?

1 Solution

Accepted Solutions
maxgro
MVP
MVP

The syntax is correct

but the "Open Position Stage" is always 'Open Positions'


Why? Because the first if is always true

If ([Status] <> 'Withdrawn' or [Status] <> 'Rejected', 'Open Positions',

View solution in original post

4 Replies
maxgro
MVP
MVP

The syntax is correct

but the "Open Position Stage" is always 'Open Positions'


Why? Because the first if is always true

If ([Status] <> 'Withdrawn' or [Status] <> 'Rejected', 'Open Positions',

Clever_Anjos
Employee
Employee

You should begin with most restrictive first

If ([Status] = 'Halted', 'Onboarding',

      If ([Status] = 'Submitted', 'In Process',

and so on...

derekrobertson2
Contributor II
Contributor II
Author

Thanks, I don't know why I didn't catch that.

derekrobertson2
Contributor II
Contributor II
Author

Thanks! Not sure why that didn't click for me.