It is a odd behavior, and haven't see this in my versions 2.0.1, 2.2.3, 2.2.4 & 3.0.
Try using this extension and export all variables and copy & paste them back to load script and modify them something like...
Let vCurrMonth ='';
Let vPrevMonth ='';
We are using 2.2.4. My understanding is that this is known, accepted behavior. Let's say I have these two lines:
LET vTest = 3;
vTest = $(vTest) * 2;
I have a sheet with a KPI displaying $(vTest). I hit Load, and it shows 6. I can hit Load a hundred times, and it will always display 6. Now I make this change:
LET vTestTypo = 3;
vTest = $(vTest) * 2;
Now it displays 12. Wait, what? Let me trying loading again, without changing anything. Now it displays 24. Load again, it shows 48. I'm expecting 6. The reason is that QlikSense saves variables with their most recent value, regardless of whether they are in the load script. After the initial run, when the typo is introduced, it remembers vTest was 6, so it doubles it (then again, and again).
This is not the only downside of this "variables persist" design, but it's the easiest to demonstrate. What I would like to do it clear out ALL variables at the start of my load script, delete them or at least set them to NULL. According to my Googling, something similar can be done in QlikView, but it requires functions/macros that QlikSense does not have. Is there a way to get a list of all QlikSense variables in the load script, and clear out their values?
In my case I have duplicated lines in the variable overview in Sense application (I have no idea how could this happen):
The variables (defined in script) cannot be edited / deleted in the front. To remove them, you need to go to script and do "set variable=;" (see Deleting a variable ‒ Qlik Sense in the official help page), reload, and then edit / delete the variable in the front.
In my case, I have to reload four times, each time one of the duplicated variable became editable then I deleted one.
Please note this works in Sense desktop 10.3.4. When I tried the same steps first in a Sense 3.1 server, it did not work (Every time I reload the script, one new editable variable appears. I can only delete this new created one. I still cannot do anything to the existing duplicated ones).
Just hope this can provide some help.
Do you have a multi node setup?
We have the same weird issue.
We are on 3.0 and had a multi node setup, but started to get lots of problems, which Qlik claims is due to sync problems between the nodes.
We have now shut down all nodes except the central node but the variable duplicates are still there.