Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
sadasiva
Contributor II

Is there any limit in using If condition in qlik?

Hi,

I am writing if condition in script.

Is there any limit that we can use only this many if conditions in single column defination?

Regards,

Sadasiva

Tags (1)
10 Replies
arulsettu
Honored Contributor III

Re: Is there any limit in using If condition in qlik?

Hi,

    As per my knowledge there no limit for using nested if condition. but it will make an impact in performance.

sumit_ranjan_pa
Contributor

Re: Is there any limit in using If condition in qlik?

HI Sada,

There are no theoretical limitations but as suggested by Arul, the performance will take big hit from it.

Prefer set analysis whenever possible and use variables to do preemptive selections. This will help with the performance and yet be useful as you want.

Thanks,

Sumit

sadasiva
Contributor II

Re: Is there any limit in using If condition in qlik?

Hi Arul,

After some If conditions,Untitled1.png

it's showing script error, any idea, why this was coming?

Regards,

Sadasiva

sadasiva
Contributor II

Re: Is there any limit in using If condition in qlik?

Hi Sumit,

I am defining a hierarchy from one column from different table. There are 5 levels of data, i need to define it in script only. Any thoughts?

Regards,

Sadasiva

arulsettu
Honored Contributor III

Re: Is there any limit in using If condition in qlik?

can you share the qvf

md_qlikview
Contributor II

Re: Is there any limit in using If condition in qlik?

Hi Sada,

As sumit suggested multiple If statements will impact on the performance of your application, which is rightly so,

you can use variable to store your hierarchy levels. Alternatively you can use Class function, provided your intervals are constant.

Eg. Class(FieldName, 1000) will create multiple levels with the interval of 1000 for entire dataset of the field specified.

Coming back to your question about script error in the screenshot attached, you might have missed ')' parenthesis for conditions written.

sadasiva
Contributor II

Re: Is there any limit in using If condition in qlik?

Hi Milind, thanks for the reply.

It's not about the ')'. dimension name itself showing in red color.

I am not able to use 'class' since there is no fixed classification.

Regards,

Sadasiva

arulsettu
Honored Contributor III

Re: Is there any limit in using If condition in qlik?

your expression looks fine. we need to check  what is the cause

sumit_ranjan_pa
Contributor

Re: Is there any limit in using If condition in qlik?

Hi Sadasiva,

You can try to pawn of the data/column to variables. You can use the variables for the fields storage or the entire IF condition to it. That will take the conditional error issues.

You can have something in these lines:

let vConditionFirst=if(a>='10010' and b<='11000','yes', 'no');

let vConditionSecond=if(a>='10010' and b<='11000','yes', 'no');


Then in the script use the variables.

As an added bonus it will make the script look clean.

Community Browser