Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Does scope of variable and their externalization affect performance

Hi All,

I have a question regarding qlikview variables.
As I have read that with equal sign a variable is calculated immediately at document level, does it mean that even though that variable is not being used in current UI but if present in variable list, will always be calculated at document level once the document is opened.

Also I have observed that the value of such variables is dependent upon the current selections. so it means that down the line of development, if we have few complex variable with equal sign at start, not being used in current document, will they still be calculated everytime whenever any selection is being made? If so will they not affect performance of document?

I am asking this because we have an application where we have externalized all the expressions (nearly 1000 variables) using variable into excel sheet. There are many equal sign variables. If the scope for them are at document level then definitely removing them from variable list will improve the performance if they are not being used in all the tabs.

What is your thought about it? and what is good practice for externalization of expression?

Thanks in advance,

Anosh

2 Replies
Gysbert_Wassenaar

Yes, all variables exist only at the document level and so are always calculated at the document level. And opening the document will recalculate all such variables. Yes, such variables will be recalculated (meaning the expression is evaluated again) when selections change. No, the recalculation will impact performance.

An expression in a variable that start with an = sign will be recalculated when the selections change and when properties of a chart object changes or when a variable changes. That's because the expression in the variable might depend on a selection or on another variable or could be itself be used in a chart object which would need to be recalculated after changing its properties.

If your expression does not really need an = sign then remove it. Only if the expression in the variable must be evaluated outside the context in which the variable is used do you need to put the = sign in front of the expression.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,

Thanks for your quick reply. I now understood the scope of variable and their performance implications.

Could you suggest me a good practics for externalization of variables like:

Should all the expressions of an application be externalized using variables. if not then when should we create a variable from an expression.

Thanks,

Anosh