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

Announcements
We are aware of an issue with the Product Downloads page and looking into it.
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

set a variable upon field selection

Hello
I got a field named MOVEMENT
it has the following values:
HC
ATTR
RECRUT
ATTR_RATE
RECRUT_RATE

I have a variable named vL.ToggleSelection
i want that if the user selects HC,RECRUT, or ATTR to set the variable vL.ToggleSelection to 1 otherwise set it to 2

how can I trigger field selection to set a variable?

I can walk on water when it freezes
Labels (4)
1 Reply
QFabian
MVP
MVP

Hi @ali_hijazi here an option for starting:

first create the variable ths way  :

=if(wildmatch(MOVEMENT,'HC', 'RECRUT', 'ATTR') > 0, 1, 2)

QFabian_6-1779726217401.png

 

 

And then you can test it , i tested in a text box :

QFabian_5-1779726118304.png

 

QFabian_2-1779726058835.pngQFabian_3-1779726080918.png

QFabian_7-1779726279787.png

 

Check the functions related to match to test  them:

https://help.qlik.com/es-ES/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ConditionalFun...

 

 

 

 

 

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.