Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Benbassou
Partner - Contributor III
Partner - Contributor III

Keep variables values after the reload

Hello,

I have a problem with variables when app get reloaded.

Let me use a simple example to understand the stuff:

  - Suppose that i have a document with a variable vTest.

  - I publish the document on the server with the variable vTest configured with default value 1

  - A user modifies the contents of the variable [vTest] to 5. If, during user's analysis, the document is reloaded on the server (data is updated), the content of the variable is automatically set to the default value 1.

I don't wanna this behaviour, i need to keep the user defined value 5 even after the reload

Does anyone have had that problem before and how to keep variables values ?

Thank you for the help

1 Solution

Accepted Solutions
sauliusr
Contributor II
Contributor II

Just mark this variable for inclusion in bookmarks and it will survive reloads. (Settings > Document properties > Variables > Settings for Selected Variable > Include in Bookmarks).

View solution in original post

15 Replies
Anil_Babu_Samineni

Describe more related how user going to select, I mean with in Input box?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Benbassou
Partner - Contributor III
Partner - Contributor III
Author

Hi Anil,

The variable value is changed with button actions and not input box.

Mark_Little
Luminary
Luminary

Hi,

How are you defining a vairable?

I would guess that you are defining in Script something like

LET vTest = 1;

Comment out the line in the script, this should stop it being changed at reload and keep the last value entered.

If this is no the case you probably have a trigger set up to reset it.

Mark

jpenuliar
Partner - Specialist III
Partner - Specialist III

you probably are trying to achieve something like this:

Save variable VALUE from application to text, csv, qvs, or qvd file

Benbassou
Partner - Contributor III
Partner - Contributor III
Author

Hi Mark,

I'm actually not initialize the variable in script, and i dont have any triggers in application.


i use this steps to create a variable

Settings -------> Variable Overview --------------> Add


and to change a variable value i use button action


thank you

Mark_Little
Luminary
Luminary

Hi again,

Probably down to the reload.

When you reload an app is the application moved from a Source Doc's folder to a User Doc's Folder?

I think you will find the Document your loading from has the variable set to 1 and the Document being viewed by your user is being replaced with the reloaded one.

A quick way check for this is to change the variable in the source document and see if on the next reload the number changes.

If this is the case i don't think there is an easy way to change this, sorry.

Mark

Benbassou
Partner - Contributor III
Partner - Contributor III
Author

Hello Mark,

Yeah, i tried that. After every reload, the value of the variable back to default value. 😕

Actually, i think it's not only about variables but all app objects are reset to original version after every reload, for exemple when i move or i change an text object, the value and the location backs to default after the reload.

thank you

regards,

Idriss

Benbassou
Partner - Contributor III
Partner - Contributor III
Author

Hello Jonathan,

Do you mean, that i should save my variables values with a macro in a file, and reset them later with script during the reload ?

regards,

Idriss

jpenuliar
Partner - Specialist III
Partner - Specialist III

i suppose that can be done with a macro.

This example allows editing value of a variable and saving to qvd by Reload action;

Loading Data into Input Boxes