Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to create a nested if statement like below but the syntax is not accepted.
Are nested if statements supported?
Thanks,
Michael
iif([PG]=1,'Item1',
Iif([PG]=2,'Item2',
Iif([PG]=3,'Item3',
Iif([PG]=4,'Item4',
Iif([PG]=5,'Item5',
Iif([PG]=6,'Item6',
Iif([PG]=7,'Item7'
)))))))
Hi,
Yes, nested if are supported.
Maybe it is because you used lif([PG]= instead of iif([PG]=. I mean, be sure you always used iif() because l could be confused with I.
Where are you trying to add the nested if?
Best Regards,
Ruggero
Hello,
What I want to do is say if PG=1 then return 'Item1', if PG=2 then return 'Item2', etc.
The problem I have is PG is dual field and in NPrinting I only get the number. I need the Item. I can't modify the Qlik document now. Is there a better way?
Thanks,
Michael
Hi,
You could also try to use ToInt(): iif(ToInt([PG])=1,'Item1',...
or ToStr(): iif(ToStr([PG])='1','Item1',...
Yes, sometimes to develop PixelPerfect formulas you have to try, test, change, try again. Forcing tha data type to text of add formulas in the source app would be better.
Best Regards,
Ruggero
Hello,
Unfortunately I cannot modifiy the source of this Qlik Dashboard.
Michael