Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
jakobjosef
Creator II
Creator II

Can an expression be too long?

Hello QV-Community

Currently I am writing an expression which is (for me personally) very long, with 23 if-statements and about 25 variables and several calculations.


So i wondered if an expression could be too long for QV? I did not realize a slower performance in QlikView yet, but is there a problem that could occur with very long expressions? Or is my expression anyway (in comparison) very short?

Thank you for your help

Jakob

1 Solution

Accepted Solutions
marcus_sommer

I'm not aware that there are limitations to the lengths within QlikView but in Sense there are a few - probably not within the engine itself else within the editor-frame from the browser. I saw anywhere a table with various of such limitations and if I remember correctly it were 8.192 chars by the expression.

Further there are limitations to the number of nested if-loops - within the old engine it were 99 and now it may a few more.

But in my opinion are such expression much too long as to be sensible to develop, to debug and to maintain and therefore I suggest to simplify such expressions as much as possible. For this it might be also useful to adjust some things within the datamodel, for example by creating appropriate categories and/or flag fields and so on.

- Marcus

View solution in original post

3 Replies
marcus_sommer

I'm not aware that there are limitations to the lengths within QlikView but in Sense there are a few - probably not within the engine itself else within the editor-frame from the browser. I saw anywhere a table with various of such limitations and if I remember correctly it were 8.192 chars by the expression.

Further there are limitations to the number of nested if-loops - within the old engine it were 99 and now it may a few more.

But in my opinion are such expression much too long as to be sensible to develop, to debug and to maintain and therefore I suggest to simplify such expressions as much as possible. For this it might be also useful to adjust some things within the datamodel, for example by creating appropriate categories and/or flag fields and so on.

- Marcus

Miguel_Angel_Baeyens

I second Marcus.


With a small data set and one single user, performance issues are less likely to appear and if they do, make sure you address them as fast as possible, because in a higher demand scenario (much more data and many more users) the degrade can be exponential.

Think if part of the logic you need for all those nested If()s couldn't be done in the script or simplified somehow using variables or set analysis.

Anyway, performance is not necessarily about length of expressions, but rather its complexity. A 25 nested If() statement can be very simple to read (if this then that, else if that then this, etc.) but with variables inside that have to be expanded and evaluated, etc. makes the whole thing complex (and yes, long as well).

To learn more, read through the Qlik Scalability‌ group documents and the Qlik Design Blog, there is a lot about performance and best practices.

jakobjosef
Creator II
Creator II
Author

Thank you so much for your q(l)uick response, I will consider your advice!

Jakob