Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
mja_jami
New Contributor III

Nested IF in Load Scirpt

Hello Qlik experts,

I need your help and skill with the data load syntax. I’ve this script which loads the ‘add_benfit‘ field from dataset with the value 'Not Classified' if NULL, with 'No AD&D' if 0 or else loads value as it is i.e.; 50000, 100000

if(IsNull(add_benfit),'Not Classified',(If(Match([add_benfit], 0), 'No AD&D', add_benfit))) as add_benfit

Now I need to add another condition to check if field gfl in dataset is either null or ‘Y’, in either case do the above, populate add_benfit in another field as gfl_ add_benfit

gfladd_benfit 
 0Want this
 50000Want this
Y50000Want this
 100000Want this
Y100000Want this
N0Don’t want

I’m getting error message when I try with:

if(IsNull(pfl) or pfl='Y',(IsNull(add_benfit),'Not Classified',(If(Match([add_benfit], 0), 'No AD&D', add_benfit)))) as gfl_add_benfit,

can anyone help me with this please? Sincerely appreciate your help.

Thank you very much.

Jami

Labels (4)
1 Solution

Accepted Solutions
Partner
Partner

Re: Nested IF in Load Scirpt

think you are missing a second if statement. in red below

if(IsNull(pfl) or pfl='Y',IF(IsNull(add_benfit),'Not Classified',(If(Match([add_benfit], 0), 'No AD&D', add_benfit)))) as gfl_add_benfit,

2 Replies
Partner
Partner

Re: Nested IF in Load Scirpt

think you are missing a second if statement. in red below

if(IsNull(pfl) or pfl='Y',IF(IsNull(add_benfit),'Not Classified',(If(Match([add_benfit], 0), 'No AD&D', add_benfit)))) as gfl_add_benfit,

mja_jami
New Contributor III

Re: Nested IF in Load Scirpt

Thank you very much! Smiley Happy