Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

derekrobertson2
New 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
MVP
MVP

Re: Multiple If statements in Qlik Sense load script

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',

4 Replies
MVP
MVP

Re: Multiple If statements in Qlik Sense load script

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',

Employee
Employee

Re: Multiple If statements in Qlik Sense load script

You should begin with most restrictive first

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

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

and so on...

derekrobertson2
New Contributor II

Re: Multiple If statements in Qlik Sense load script

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

derekrobertson2
New Contributor II

Re: Multiple If statements in Qlik Sense load script

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