Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

clear selections explicitly

I am building out a scorecard system with about 4 listboxes. The requirements call for a make/model/year concept. The first box filters choices for the second and so on. All of that is working well. During testing the users were able to “break” the document by de-selecting  say the 3rd listbox and then selecting another choice.  The document then either locks up or shows bad data. I am pretty sure the problem is because there is an active selection on list box 4 when listbox 3’s selection is cleared.


I also have display conditions that require a single value to be selected for any hierarchically superior listbox. i.e. For listbox 3  the condition is - GetSelectedCount(Listbox1)=1 and GetSelectedCount(Listbox2)=1


I am thinking that the way to solve this is to clear listbox 4 explicitly when listbox 3 is cleared. The document triggers look promising, but I need to be able to wrap a condition around the trigger. I was thinking that the on change trigger would have to see if the geselectedcount was 0 for the superior listbox and if so, it would clear the subordinates. Is a Macro a good way to do this? Any hints on syntax for using the Qlikview functions and actions like getselectedcount(fieldname) and clear field(fieldname).

Also should mention that we are using the server/publisher model with the majority of our users accessing solutions via the web interface.

  Thanks for your help.     



4 Replies
danieloberbilli
Specialist II
Specialist II

Maybe this helps: clear selection in listbox 4 if change in listbox 3:

Doc Properties ->Triggers->FieldEventTriggers ->Listbox3 -> OnChange Add action ->selection =Clear field -> Field: Listbox4

Not applicable
Author

Thanks for your reply. The OnChange trigger seems to fire when any related field is changed, This is different than the OnSelect which seems confined to the field the trigger is assigned to. Is there a way to limit the "focus" or scope of the OnChange event to just the single field? If there was, that would do it!

danieloberbilli
Specialist II
Specialist II

Another possibility: what about mark 'Hide excluded' on the general tab of the listbox4 ... so that the use cannot choose any 'forbidden' value in listbox4?

danieloberbilli
Specialist II
Specialist II

or...use your idea with the GetSelectedCount on the final object (e.g. the result table or final listbox) where the condition in calculating or showing is

GetSelectedCount(Listbox1)=1 and

GetSelectedCount(Listbox2)=1 and

GetSelectedCount(Listbox3)=1 and

GetSelectedCount(Listbox4)=1