Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

In Function

The syntax underlying the "In" function is incorrect.  I need help correcting the "In" Function.  The attached files provide the supporting documents.  Here's the script containing the "In function:

LOAD *, if([Policy Type]='U','STB',if([Policy Type] in ('B','S'),'FRM',if(isnull([Profession Descr]),'NEW',[Profession Flag]))) as Profession

1 Solution

Accepted Solutions
sunny_talwar

Try with Match()

If([Policy Type]='U','STB',

If(Match([Policy Type], 'B', 'S'), 'FRM',

If(IsNull([Profession Descr]), 'NEW', [Profession Flag]))) as Profession

View solution in original post

5 Replies
Not applicable
Author

I just replaced the "In" Function with the "Or" Function and the syntax works.  I guess the "In" function is not used in Qlikview, but I'm not sure.

LOAD *, if([Policy Type]='U','STB',if([Policy Type] = 'B' or 'S','FRM',if(isnull([Profession Descr]),'NEW',[Profession Flag]))) as Profession

sunny_talwar

Try with Match()

If([Policy Type]='U','STB',

If(Match([Policy Type], 'B', 'S'), 'FRM',

If(IsNull([Profession Descr]), 'NEW', [Profession Flag]))) as Profession

Not applicable
Author

Thanks again Sunny, I was not familiar with the Match function.  I guess there is more than one method here, I can use the "Or" function as well, correct  (see my prior reply) ?  Your syntax works perfectly !!

sunny_talwar

Yes you can. Or will work like this

If([Policy Type]='U','STB',

If([Policy Type] = 'B' or [Policy Type] = 'S'), 'FRM',

If(IsNull([Profession Descr]), 'NEW', [Profession Flag]))) as Profession

Not applicable
Author

Thanks again Sunny !