Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

set variable on active selection

Hi all,

i need help with a script.

I have a List Box like this : A

                                       B

                                      

and a variable vshowChart.

So when i select for example value 'A' i need variable set to '1', when 'B' variable set to '0'

Can u help me pls?

Tyvm

1 Solution

Accepted Solutions

Re: set variable on active selection

Add an action to the OnSelect field trigger of the field in your listbox (Look on the Triggers tab of the document properties window). Choose External and then Set Variable to get the right action. Set the variable name to vShowChart and use this expression: =if(MyField='A',1,0). Replace MyField with the name of the field of the listbox.


talk is cheap, supply exceeds demand
3 Replies
MVP
MVP

Re: set variable on active selection

PFA, used field event trigger

Re: set variable on active selection

Add an action to the OnSelect field trigger of the field in your listbox (Look on the Triggers tab of the document properties window). Choose External and then Set Variable to get the right action. Set the variable name to vShowChart and use this expression: =if(MyField='A',1,0). Replace MyField with the name of the field of the listbox.


talk is cheap, supply exceeds demand
sushil353
Honored Contributor II

Re: set variable on active selection

lets say your listbox field name is F1

then use

=vVariable=if(getfieldselections(F1)='A',1,0)

HTH

Sushil

Community Browser