Deleting script variables

By Barry Harmsen

This post was inspired by a gentleman I met at a QlikTech Partner meeting who was adamant that a script variable, once created, cannot be deleted. Of course this can be done, and here’s how.

If the variable already exists in the front-end, we first have to remove it there. This is done by opening the variable overview (Ctrl + Alt + V), selecting the variable and pressing “Remove”.

The next step is to assign a value of null() to the variable in the script. For example, to delete the variable vVariableToRemove we would use the following script:

LET vVariableToRemove = null();

And that’s it, no more unwanted script variables cluttering up your front-end variable overview. You can download an example qvw by clicking here.