Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

anonymous1
New Contributor III

Toggle Button

Hi, 

ive created a toggle button which i want to override selection made in list box and switch between 2 bar charts.

i created a variable(vOverrideVariable):

= if(vOverrideVariable = 0,1,0)

i created a button:

Actions>Set Variable> Variable = vOverrideVariable

in both the bar charts, under Layout> Show>Conditional:

vOverrideVariable=1 for chart1 and vOverrideVariable=0 for chart2

however, when i select the button, the variable definition is disappearing? does anyone have any idea as to how this is possible?

TIA

 

Labels (2)
1 Solution

Accepted Solutions
olivetwist
Contributor

Re: Toggle Button

Maybe along the lines of:

IF(vOverideSelection = 1,1,GetFieldSelections(graph_type))

6 Replies
olivetwist
Contributor

Re: Toggle Button

I'm not sure why it is disappearing, but try setting the action like this:

Set Variable > Variable = vOverrideVariable; Value =-$(vOverrideVariable)

And set you charts to:

vOverrideVariable=1 for chart1 and vOverrideVariable=-1 for chart2

jwaligora
New Contributor III

Re: Toggle Button

When I toggle, the variable typically doesn't hold the function, just the value itself. The function lives in the Button trigger.  Also, remember to create and initialize the variable to one of its two possible values.

Toggle Setting A:

QV_Sample_8.png

Toggle Setting B:

QV_Sample_9.png

Variable and Button Settings:

QV_Sample_10.png

J.

Highlighted
anonymous1
New Contributor III

Re: Toggle Button

 thank you everyone for your responses, i now have it working.  although the the graphs will change with the toggle button and no longer with the selection list box, is it possible to allow it to change with both?

olivetwist
Contributor

Re: Toggle Button

I'm not following. You want to use a list box selection to show or hide certain graphs? can you give me more info? do you have a field like "graph_type" with values "1,0"?

olivetwist
Contributor

Re: Toggle Button

Maybe along the lines of:

IF(vOverideSelection = 1,1,GetFieldSelections(graph_type))

Support
Support

Re: Toggle Button

Please be sure to mark any posts that helped you resolve the issue with the Accept as Solution button, and if the other posts did not help, and you solved it yourself, please provide details of what you did to solve it and then mark that post as the solution.  If you still need further help, please provide a further update/information as well.

Regards,
Brett

To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.