Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is there a limit to the number of Nested IF statements in the Script editor?

Hi,

I am currently working with a Qlikview application whereby I am trying to create a new Field in the Qlikview Script based on whether specific codes exist. If the codes do exist, then they should be included within the new field

This seems to work fine, up until a certain point. At present there are 37 IF statements within this particular code, e.g:

IF(WAGE_GRP&'-'&WAGE_CODE_NAME='Absence-AWOL','AWOL',

  IF(WAGE_GRP&'-'&WAGE_CODE_NAME='Absence-Annual Paid Leave','APL',

   IF(WAGE_GRP&'-'&WAGE_CODE_NAME='Normal-Sick','Sick Absence')))

     AS Absences

What seems to happen, is that after the 26th IF statement, the remaining records are not recognised. No errors are raised during the reload process, and the syntax appears to look ok? Does Qlikview have a limit on the number of nested IF statements, or the number of characters?

I can do this via an Inline Load, which will overcome the problem, but I would like to know if there is a limit?

Many Thanks

Ben

4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    There is limit on the use of IF statement( As far as i know).

    If you can provide the qvw file. It will help me to understand and find the problem.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable
Author

Think there's some limit there, around 100 or something. In this case, you might want to use a Mapping table instead?

Not applicable
Author

Could you explain how to build a mapping table for this usage ?

Thanks in advance

antose
Partner - Creator II
Partner - Creator II

AS Johannes mentions.

Create a Inline Table or a XLS document with two columns Code and Desc.

Then Create a Mapping Table on this data.

Where you should use this data you add a ApplyMap and send in your Codes.

Something similar with this:

Skärmklipp.JPG.jpg