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

Setting Variables

Hi,

I have multiple variables that I would like to use an action to update the variables values.

The problem is that it is time consuming to create many single actions for each variable, is it possible to set one action and have multiple variables change?

Basically, what would be ideal if it was possible to write in 40 or more variables in one "set variable" action.

Thanks,

Kosta

1 Solution

Accepted Solutions
Digvijay_Singh

See if something like attached can help -

View solution in original post

6 Replies
swuehl
MVP
MVP

I don't think that's possible with an action.

jagan
Luminary Alumni
Luminary Alumni

Hi,

With one action you can set only one variable.  If you have 40 variables then you have to use 40 actions.  You can try using Macros and set values for 40 variables in single place instead of adding 40 actions.

Sometimes macros won't work in non IE Plugin versions, test it thoroughly.

Check this link for sample macro code snippets.

Useful Qlikview Macros

Regards,

Jagan.

Digvijay_Singh

See if something like attached can help -

Kushal_Chawda

You can use for loop in script to update the more than 40 variables at one go. But can you explain what is the need and what you are trying to achieve?

Not applicable
Author

Basically I have a number of variables - upwards of 40 - that the user will be able to adjust.  The variables are used to in a dynamic update action.  So I have a button that has a dynamic update action, I also want the button to change colour if any of the variables are different.  (I cannot use any macros due to server functionality)

My plan was to have a second variable - "baseline" variable - for each one.  The update button would change colour if any of the "changeable" variables were altered from the "baseline" variable value.  Then the update button would have an action to set the baseline variable to the value of the changeable variables during the update action so that the button would go back to the unchanged colour.

Hopefully this explains it properly. 

I believe Digvijay's solution is my best method, I am just trying to figure out the best way to apply it.   Also, it is a very interesting method that I have not seen before!

jagan
Luminary Alumni
Luminary Alumni

Hi,

Yes you can use Input box with required variables in it and you can change it easily.

Regards,

Jagan.