Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Double Click on Field Reset's the Variable

Hello,

I have say field - 'A' in List box on selection of which I am setting variable as 1. This works well when i click on "A"  once.

Next time if i click the same Field - "A" twice variable is set back to 0.

I want to avoid this. Anytime i select in ListBox a field value - 'A' my variable should be 1.

1 Solution

Accepted Solutions
morganaaron
Specialist
Specialist

Also, instead of a field event trigger, why not set the variable's definition to be:

=if(GetSelectedCount(FieldA)>0,1,0) - which will set the variable to 1 as long as there is a selection in Field A, but will set it to 0 otherwise.

View solution in original post

5 Replies
morganaaron
Specialist
Specialist

Hi Shree,

What's your exact script for setting the variable? And is it done as a document trigger (i.e. an OnSelect attached to the field in the listbox)?

Anonymous
Not applicable
Author

It's done on Settings >> Triggers >> Field Event Triggers >> OnSelect.

puttemans
Specialist
Specialist

Not sure whether I understand your question correct, but within QV, you click once on a variable in a listbox to select it. If you click on it again, you will deselect it.

morganaaron
Specialist
Specialist

If you're triggering a variable to be set as 1 onselect of a field, it shouldn't revert back to 0 unless there's a condition allowing it to do so - can you post your .qvw? Or what you're setting the variable to (or is it just '1'?)

morganaaron
Specialist
Specialist

Also, instead of a field event trigger, why not set the variable's definition to be:

=if(GetSelectedCount(FieldA)>0,1,0) - which will set the variable to 1 as long as there is a selection in Field A, but will set it to 0 otherwise.