Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
mstoler
Partner - Specialist
Partner - Specialist

nest iif statement for Pixel Perfect

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'
)))))))

Labels (2)
4 Replies
Ruggero_Piccoli
Support
Support

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



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
mstoler
Partner - Specialist
Partner - Specialist
Author

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

 

Ruggero_Piccoli
Support
Support

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

 



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
mstoler
Partner - Specialist
Partner - Specialist
Author

Hello,

Unfortunately I cannot modifiy the source of this Qlik Dashboard.

 

Michael