Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

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
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
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)?

Contributor II
Contributor II

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

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.

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'?)

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