Discussion Board for collaboration related to QlikView App Development.
Is there a way in QV to drop/hide temporarily used variables in a script ?
When reloading QV files, we are using quite some temporary variables (current date, number of years to reload, start year, QVD - folderpaths, ...) that are of no use for QV professionals and/or end users
Is there a way to drop (selected number of) variables at the end of your reload script or at least hide them one way or another for the professional / end users ? The professional user will often make use of variables himself (we encourage this instead of hard coded values), but the variable list tends to become quite long with variables that are only needed during the reload stage. Quite some variables are set at the beginning of the reload script using one or more includes (create once / use everywhere) so it would be nice if we could run an include at the end that removes the 'unnecessary' variables from the QV file.
That is not exactly what I mean.
It's not that my professional / end users may not see the contents of the variable, I mean the variable itself.
The include's contain variables for database connections, network paths to store QVD files, ...
All these variables are now stored within the several QV applications, while they are only of use during the reload sessions itself.
I was thinking of a way drop (or hide) them at the end of the reload (compare it with going to the variable overview and deleting them manually).
Depending on how are you loading your document, I'd give a try to create a macro with the code
Sub CleanUp ActiveDocument.RemoveVariable "vVar"End Sub
And trigger it in the Settings menu, Document Properties, Triggers, OnPostReload.
Hope that helps.
Also interested in an answer to this. Sometimes we might end up storing credentials in QlikView variables during the load script cycle. Is there a way to ensure these are blanked after the reload has run (even if the reload fails for some reason?)
You can also loop over a variable list and set them to Nothing at the end of the script ...
for each v in 'a','b','c','d','e','v'
LET '$(v)' = Nothing;
... but this won't run if there's been a failure. In that case you would need to wrap error handling around all or parts of the code and then test for failures to determine if variables need cleaning up.