Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I clear all QlikSense variables?

It seems QlikSense variables are stored even after the variable definition is deleted, which can cause unexpected results. It can make things very difficult to debug when there is no variable defined in the load script, but it is used (and has a value). How can I clear ALL variables at the start of my load script (without knowing variable names)?

Thanks

11 Replies
gandalfgray
Specialist II
Specialist II

Fei:

The duplicates are due to a bug in Sense.

Contact Qlik Support.

We had an app with more than 40000(!) duplicated variables due to this bug.

It took approx 2 minutes to open this app in the hub.

Qlik had to write a program to remove the duplicates.

Now it takes 4 seconds to open the app!

diego_barboza
Partner - Contributor
Partner - Contributor

First of all, let me clarify that you do not need to declare all variables that you will use at the beginning of the script: If it was used on a previous run of the script or if it was created from the user interface, it will be saved and you can call it again whenever you want during the script (using the last defined value) The first time you run the script, you create the variable.

   LET vTest = 3;

   vTest = $(vTest) * 2;

If you don't change the script, the variable already exists with value six (6) , but when you reach here, you redefine the value of vTest again to three(3) and then to six (6)

   LET vTest = 3;

   vTest = $(vTest) * 2;

Qlik remembers the value of this variable, so if you don't change it, Qlik will only read this:

  vTest = $(vTest) * 2;

This is working as intended, since the Idea is that (in some cases) you can define Variables from the user interface or from outside the application (via EDX or QMC in QlikView, for instance)