Assume instead of using expressions in charts directly (in run time), I store expressions in the script using SET or LET function in a variable while loading.
Now could you tell me which method will take loading issues in the front end from below points,
1. Writing expressions in the charts directly - first data will be fetched into the model and then the expression will be processed.
2. Store those expressions in the script using SET or LET functions - Expressions are processed and will be stored in memory.
please say which method is preferable and also please intimate whether above mentioned 2 points are correct.
Point one is correct you should write expression at fronted . If you have some calculations then you can write on script level.
At fronted you can easily change expression but backed you need to reload so i will suggest in fronted(charts).
Thanks for your reply, Arvind. I have very complex expression for 3 or more charts. If I go with point 1 as you suggested, the expression will be processed in the run time.
If I store those expressions as dimensions or variables as a measure, will it be more easily load the the expected data, right?
Either you write the expressions in chart or you store it in variable using SET or LET, it will take the same time to calculate the expression. Your front end expression evaluates every time when you make any selection.
see this to better understand see the below
Simplifying, in QlikView, all data from the different sources, either those be QVD files, spreadsheets, CSV, database tables, whatever, is loaded into memory as the first step, before any calculation could happen.
So regardless where do you actually write the expression, performance and memory use will be very similar.
To name a few key advantages to have expressions in an external file or in the script:
However there are also important disadvantages:
The variables will be expanded (processed) always in run time, except in one case, when the first character in the value of the variable is the "=" sign. In this case, the value is indeed evaluated with every click and represented wherever the variable is expanded. So the variable does not need to be called to be calculated.
It will come to your very personal way of development where to keep the variables: in the script, external files or directly on your charts. This will also will vary widely depending on the customer and the nature of the development, e.g.: when you need to reload every time to reflect a change in the variable, you spend a lot of time, if you work alone you could store everything on the expressions, if you work in a team you would need to share this, if the customer has very strong ITIL requirements, it will likely require you to save expressions somewhere else. If you abuse global variables ("=" as the first character in the value), performance can be severely affected.
In my case, very seldom use the script for expressions, but sometimes I have to use an external file so others can use the same syntax.