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: 
ashis
Creator III
Creator III

How to change field value using variable

Hello,

I have a field in my data model called flag, that has values 1 and 2 . When we select 1 or 2 some specific field values get selected. 

Now I need to create a variable that would do toggle (0 or 1) and based on that toggle values my field flag value would be selected .

suppose variable name is vVar , then I want 

if vVar =0 , then select Flag value =1,

if vVar =1, then select Flag value =2

Please help how to get this done.

Labels (3)
4 Replies
vinieme12
Champion III
Champion III

You can create two buttons each with two actions 

First button

1 action set variable to 0

2 action select flag value = 1

Second button 

1 action set variable to 1

2 action select flag value = 2

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
ashis
Creator III
Creator III
Author

Hi Vinieme, thank you so much for your reply. Actually I do not want to use button in the  QlikSense dashboard.

we want to toggle using Vizlib switch that would only change variable values.

Without button, can you think of other way please.

vinieme12
Champion III
Champion III

AFAIK variables can't trigger field selections

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
marcus_sommer

You may create a second parallel field which contained these values. Another option might be to use dual() to show 1 and 2 but the underlying values are 0 and 1. Further you may query the set selections within the expressions to create dynamic views.

- Marcus