Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
mja_jami
Contributor III
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 (2)
1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

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,

View solution in original post

2 Replies
dplr-rn
Partner - Master III
Partner - Master III

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
Contributor III
Contributor III
Author

Thank you very much! Smiley Happy