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: 
charlotte_garnier
Contributor
Contributor

Change a variable value

Hi Community,

Here's my context :

I have a graph with varius curves and I'd like to set a button to display/ hide some of them. 

I created a variable set to value 1 and I linked it with the "Visibility Condition" of my curve. It works when I change the variable value in the variables management window but I can't manage to write a function that changes the value when I click on a button.

Can someone help me then ?

Labels (4)
1 Reply
Or
MVP
MVP

Create your button with an action of Set Variable Value, and use e.g.

=if(myVariable = 'Foo', 'Bar','Foo')

In this case, if the value is already Foo, it will be changed to Bar, and if it already Bar, it will be changed to Foo.