Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
FLASH SALE: Save $500! Use code FLASH2026 at checkout until Feb 14th at 11:59PM ET. Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
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

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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

View solution in original post

3 Replies
tresB
Champion III
Champion III

PFA, used field event trigger

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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
Master II
Master II

lets say your listbox field name is F1

then use

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

HTH

Sushil