Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
michael84
Contributor II
Contributor II

Set variable value

Hello

Does anyone know how to set two variable values at once? I have a Button and there is the possibility to add Actions. The Action Type "External" has the possibility to set a variable. How do i have to write the value, so that the Button selects the two values of the same variable?bsp.gif

Thanks for your help...

Michael

8 Replies
masha-ecraft
Partner - Creator
Partner - Creator

Hi Michael,

A variable can have only one value. So you can not set it to 2 values.

But if you want your button to trigger a selection in some field, then you need a different kind of action, e.g. 'Select in Field'.

Regards,

Masha

jagannalla
Partner - Specialist III
Partner - Specialist III

Hello,

Use this code in Value Text box:

=v1 & 'and' & v2

Cheeers!!

Jagan

Anonymous
Not applicable

Hi, adding to Masha A's response. You have the possibilty to set a range of values and pass those to set analysis.

For instance in the Value field of the Set Variable screen you enter 5, 100. And then use this as a variable in set analysis, for instance Sum({$<OpsID={$(vOPS)}>} Sales). Regards, Sander

Not applicable

Hi Michael,

what do you want to do with OPS variable?

Value of variable can be in certian situations interpreted as a more than one value, as it is in attached example.

regards

michael84
Contributor II
Contributor II
Author

I use the variable as a Conditional in a Chart.

exp.jpg

I want to create a report where two Charts with different Conditional are displayed together but in the application they should not be displaied together. So my guess was to set two values at once, which in this case, referring to Masha,  does not work unless someone has another idea...

Many thanks for your help

regards Michael

jagannalla
Partner - Specialist III
Partner - Specialist III

Hello,

If i understood your problem. Take two buttons one for chart1 and another for chart2. Give the conditions for both charts as:

chart1 condition: vOps=1

chart1 condition: vOps=2.

Button1 -> Set Variable -> Variable as vOps and Value as 1

Button2 -> Set Variable -> Variable as vOps and Value as 2

When you click on button1 it shows first chart and when you click on second button it shows second chart.

If i'm not clear please explain clearly what you need exactly with sample example or sample example with qvw file.

Hope it helps you.

Cheers!!!

Jagan

michael84
Contributor II
Contributor II
Author

Hi Jagan

Thanks for your answer. What you describe is how it is right now. What I try is the following:

chart1 condition: vOps=1

chart2 condition: vOps=2.

Button1 -> Set Variable -> Variable is vOps and Value is 1 and 2

I guess this is not possible...

Regards Michael

jagannalla
Partner - Specialist III
Partner - Specialist III

Hello,

You need functionality with single button. Plz check the attached file for this.