Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

dennis_o
New Contributor III

Strange behaviour of variables

I use a script which creates variables.

Their values are set within IF-clauses.

I load the script and then they work fine in the app-view, but when I restart my browser their values are different

(The values are from different if-clause outcomes).

Why do their value change when I restart my browser?

I thought their values are bound to the last value they received, from the variable editor or the data load script.

Do I need to store all variables in tables and reload them as a workaround or is there a better solution?

12 Replies
MVP
MVP

Re: Strange behaviour of variables

Do you have On-Open trigger which might cause the value of the variable to change for some reason?

dennis_o
New Contributor III

Re: Strange behaviour of variables

Not that i would know - I am basically just loading and opening the app / closing browser and opening again

MVP
MVP

Re: Strange behaviour of variables

Are you able to save a copy of the dashboard and check if there is any on-open trigger?

dennis_o
New Contributor III

Re: Strange behaviour of variables

I don't think I have the permissions to see or set triggers.

Is there a kind of trigger preventing variables to be saved?

MVP
MVP

Re: Strange behaviour of variables

I think it might be saved to one value, but there might be a trigger which changes it's value as soon as your reopen the dashboard.

dennis_o
New Contributor III

Re: Strange behaviour of variables

It may be trivial but I noticed that the variables also reset when I don't open the app-view in a new tab but inside the data load editor-window.

dennis_o
New Contributor III

Re: Strange behaviour of variables

I noticed something less trivial:

scenario:

     var1 = true;

     var2 does not yet exist

script:

     LET var1 = FALSE();    

     LET var2 = FALSE();

after load:

     var1 = true;

     var2 = false;

The important thing is, that var2 is noticed as being loaded from the script, while var1 is not

dennis_o
New Contributor III

Re: Strange behaviour of variables

New variables can be changed as I wish and keep their values,

old variables (past days) won't change.

I am working on a server - I guess this is linked to the main problem?

MVP
MVP

Re: Strange behaviour of variables

Not sure, may be pcammaert‌ can offer his expert advice here