Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Tags (1)
4 Replies

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

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

jsn
Honored Contributor

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

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

Not applicable

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

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

Thanks in advance

antose
Contributor II

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

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

Community Browser