Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to translate this IF statement in Qlikview statement ?
If
(
left([Account ID], 3) in ('105','104','530','550','580','730','750','751','830','850','901') and left ([Purchase Order], 1) in ('1','2','5','7','8') and left ([Project ID], 1) in ('0','4')
) then ('NonCapital - Direct')
else If
(
left([Account ID], 3) in ('105','104','530','550','580','730','750','751','830','850','901') and left([Purchase Order], 1) in ('1','2','5','7','8') and left ([Project ID], 1) in ('1')
) then ('NonCapital -MtestIndirect')
else if
(
left([Account ID], 3) in ('105','104') and left([Purchase Order], 1) in ('1','2','5','7','8') and [Project ID] is null ) then ('NonCapital - MTest')
else ('Undefine')
Thanks,
Henness
I think you can replace the in using match() function and use the if() statement with then,else branch included as arguments and separated by commas:
If
(
match(left([Account ID], 3),'105','104','530','550','580','730','750','751','830','850','901') and match(left ([Purchase Order], 1),'1','2','5','7','8') and match(left ([Project ID], 1),'0','4')
, 'NonCapital - Direct'
, If
(
match(left([Account ID], 3),'105','104','530','550','580','730','750','751','830','850','901') and match(left([Purchase Order], 1),'1','2','5','7','8') and match(left ([Project ID], 1),'1')
,'NonCapital -MtestIndirect'
, if
(
match (left([Account ID], 3),'105','104') and match(left([Purchase Order], 1),'1','2','5','7','8') and isnull([Project ID]) ,'NonCapital - MTest'
,'Undefine'
)))
Hope I haven't forgot too many brackets,
Stefan
I think you can replace the in using match() function and use the if() statement with then,else branch included as arguments and separated by commas:
If
(
match(left([Account ID], 3),'105','104','530','550','580','730','750','751','830','850','901') and match(left ([Purchase Order], 1),'1','2','5','7','8') and match(left ([Project ID], 1),'0','4')
, 'NonCapital - Direct'
, If
(
match(left([Account ID], 3),'105','104','530','550','580','730','750','751','830','850','901') and match(left([Purchase Order], 1),'1','2','5','7','8') and match(left ([Project ID], 1),'1')
,'NonCapital -MtestIndirect'
, if
(
match (left([Account ID], 3),'105','104') and match(left([Purchase Order], 1),'1','2','5','7','8') and isnull([Project ID]) ,'NonCapital - MTest'
,'Undefine'
)))
Hope I haven't forgot too many brackets,
Stefan
Thank you for your help !! It works !!