Is it possible to modify the list of Enrvironment / System variables across all qlikview documents?
I have created a variable that, based on the location of the current document, displays the path to the data store (For ease of portability of QVW's between live and development environments on the same QV server). I would like to include this variable declaration statement in all new Qlikview documents, for all of our 5 developers.
I have seen the use of a statement to call expressions stored in an external spreasheet, but this still requires developers to add this statement into each QVW... is there a way to automate adding this statement for each new QVW?
The other solution is to prepare a flat file (or xls,...) with 2 column (VAR_NAME, VAR_VALUE) and proceed with following script:
RPT_VARS: SQL SELECT VAR_NAME, VAR_VALUE FROM REPORT_VARIABLES;
Let RowCount = NumMax(NoOfRows('RPT_VARS'),0)-1; For i=0 to '$(RowCount)' Let TempVarName = peek('VAR_NAME',$(i),'RPT_VARS'); Let TempVarValue = peek('VAR_VALUE',$(i),'RPT_VARS'); Let $(TempVarName) = '$(TempVarValue)'; next
My purpose with the include is exactly that, that is, chaging the already existing variables in the script, to get localized number/date/money formats, even month names. I may have missed the actual requirement, though.
Syntax for QlikView has to be respected, so yes, the plain text in the Include case must contain script. Include doesn't do only for variables, but for any piece of script you want to load from an external file.
Anyway, my guess is that performance of the include variable is always better than the other, because, at the end of the day, what you are doing is the same, but by means of a loop (slower), and eventually it does
LET TempVarName = TempVarValue;
what is, if you take a look at the code, what is already wirtten in the Include file. So why not doing it directly?
Again, if I missed the point just ignore the post.