Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Limit on If conditions

Dear Members,

Recently I faced one strange issue.

I had a Qlik Sense setup with version 3.2

On this version we had developed one application which was having some conditional statements, like If.

One of the If statement had 150+ more conditional statements, which was working fine.

Later we upgraded the Qlik Sense to version June 2017 patch 3.

Immediately after that the If statement with 150+ conditions started giving error.

I checked the script and there was no change made in script.

I tried so many things but couldn't find the reason, then one such testing I thought of this limit and

to confirm this I commented couple of statements and made the count below 150 and it worked.

Does anyone has encountered this behaviour before.

Does anyone has any workaround for this situation?

Does anyone know about such limitation? There is no article or any info available at the moment.

Thanks

Regards,

Kaushik Solanki

Tags (1)
3 Replies
MVP
MVP

Re: Limit on If conditions

Does anyone has any workaround for this situation?

maybe you can split the if conditions in 2 groups

this is an over simplified example with a limit of 4 if

Load

     f1,

     if(f1 = 5, 'e',

     if(f1 = 6, 'f',

     if(f1 = 7, 'g',

     if(f1 = 8, 'h',

     f2

     )))) as f2

;

Load

     f1,

     if(f1 = 1, 'a',

     if(f1 = 2, 'b',

     if(f1 = 3, 'c',

     if(f1 = 4, 'd',

     f1)))) as f2

;

LOAD * Inline [

f1

1

2

3

4

5

6

7

8

];

Re: Limit on If conditions

I do expect such a limitation. Within the earlier QlikView releases there was a limit of 99 nested if-conditions and in my opinion it's a useful restriction to ensure stability. I think within the newer releases of QlikView and Qlik Sense there are furthermore limitations to n nested if's - maybe they are higher now and there might be also one or two releases where this limitation wasn't wrongly enabled.

Beside this I believe that there are other/better ways to construct a query with many conditions than with nested-if's. For instant the example from Massimo here could be easily handled with a pick(match()) solution.

- Marcus

Re: Limit on If conditions

Thanks Marcus for the inputs.

Thing is that, this code is written by someone else and should be changed by someone else. I just posted the question on his behalf. Anyways I have already told the work around to them.

Regards,

Kaushik Solanki