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: 
jwaligora
Creator II
Creator II

Using a button to set a variable that's alternate state dependent

Hi,

In its simplest form, what I'm after is a toggle variable that has two versions, one per alternate state; each version is set by a separate button. Essentially the easy solution is just to have two separate variables (one per state), but I'm just trying to understand if sticking with a single variable would be at all possible.

Scenario: 

Alternate State A has button A that 'Sets Variable' vToggle using equation = if(vToggle=0,1,0)
Alternate State B has button B that 'Sets Variable' vToggle using equation = if(vToggle=0,1,0)

Note: In my implementation, Alternate States A & B are in separate tabs with all objects relying on alternate state inheritance.

I thought that relying on 'Alternate State' = <inherited> in the General tab of the buttons along with 'Alternate State'=A (or B, depending on button location), would be sufficient to control these toggles independently, but they still seem to be tied together. Perhaps my problem goes back to creation of the variable. Either way, I'm looking for feedback / suggestions. 

Thanks.

Labels (1)
2 Replies
Or
MVP
MVP

As far as I know, variables don't have states, meaning you would need to create two variables.

jwaligora
Creator II
Creator II
Author

So there's this link here: https://help.qlik.com/en-US/qlikview/May2023/Subsystems/Client/Content/QV_QlikView/Alternate%20State.... but I guess I'm not sure how to integrate the expansion into the button logic.