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

Multiple conditions under if statement in QlikView Script

I am trying to create a field/dimension based on multiple if statement.

However, I get error if I try to use multiple conditions under one if statement.

For example:-

if([Country] = 'France ',[Valid_YN]= 'Yes',[Code]= 'AA5','AA6','AA3',[Branch]<>'221,'223','224',[Amount1],'0',

if([Country] = ''France' and [Process]  = 'A','B' ,[Company] = 'X',[Amount1]+[Amount2])) as [Net_Amount]

Could any one please help me to work on the right approach towards this issue ?

Thanks !!!!

1 Solution

Accepted Solutions
hrlinder
Honored Contributor

Re: Multiple conditions under if statement in QlikView Script

mot sure it thats what you want,

if([Country] = 'France ' and [Valid_YN]= 'Yes' and match([Code]='AA5','AA6','AA3')>0 and match([Branch],'221,'223','224')=0,[Amount1],'0',

if([Country] = ''France' and [Process]  .... same as above

you Need to use and/or  to separate the different conditions

3 Replies
Employee
Employee

Re: Multiple conditions under if statement in QlikView Script

1) You need to use "and" and "or" instead of comma between your conditions.

2) You need to use Match() instead of a test against several values, e.g.

      Match(

, 'AA5','AA6','AA3')

HIC

hrlinder
Honored Contributor

Re: Multiple conditions under if statement in QlikView Script

mot sure it thats what you want,

if([Country] = 'France ' and [Valid_YN]= 'Yes' and match([Code]='AA5','AA6','AA3')>0 and match([Branch],'221,'223','224')=0,[Amount1],'0',

if([Country] = ''France' and [Process]  .... same as above

you Need to use and/or  to separate the different conditions

Not applicable

Re: Multiple conditions under if statement in QlikView Script

Thanks Rudolf...It works

Community Browser