Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Change variable values

In mi script i declare some variables with initial values

then i have an input box where the user can modify the values of these variables

but when i use them to make calculations, the variables always contain the initial value

is there a way to update the value of variables without reload the script?

1 Solution

Accepted Solutions
jvitantonio
Luminary Alumni
Luminary Alumni

oh, I see. If you need to use that, you have to re-execute the script.

You can also use the ADD parameter infront of LOAD and use PArtial Reload. This will only execute that part of the script so you don't have to reload the hole application.

Check you the Help for ADD.

View solution in original post

6 Replies
jvitantonio
Luminary Alumni
Luminary Alumni

The variable will take the value that you put in the input box. Are you sure yuo assign that variable to the input box object?

Not applicable
Author

The problem is that I have to use the modified variable value in the script to make calculations (to create a new field)

How can i make it work?

Maybe i can attach here my .qvw file to explain better, if only I understand how to do this...

jvitantonio
Luminary Alumni
Luminary Alumni

oh, I see. If you need to use that, you have to re-execute the script.

You can also use the ADD parameter infront of LOAD and use PArtial Reload. This will only execute that part of the script so you don't have to reload the hole application.

Check you the Help for ADD.

Not applicable
Author

Mmh...
can´t get it working

I have added the ADD prefix to the script part which i need to reload, then used the partial reload command

When i do that, the variable value gets reset, and the modification made by the user gets lost

It seems that even with the partial reload the scipt is fully reloaded, not only the parts with the ADD command

Therefore teh variables are reset to the default values specified in the script

Not applicable
Author

I have the solution!

I included the variables definition in:

if not IsPartialReload() then

vX = 0;

end if;

So it only executes that when it`s NOT a partial reload 😃