Discussion Board for collaboration on QlikView Scripting.
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 !!!!
Solved! Go to Solution.
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
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
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
Thanks Rudolf...It works