Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Re: In Function

Try with Match()

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

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

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

5 Replies
Not applicable

Re: In Function

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

Re: In Function

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

Re: In Function

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 !!

Re: In Function

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

Re: In Function

Thanks again Sunny !

Community Browser