Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

get last selected value from listbox?

Hi,

I want to be able to get the last value that is selected in the listbox. I want to force the listbox to only select the value that was last selected and clear other value if a user makes multiple selections. I basically want to force the user to only make one selection. I used the below code in the onanyselect trigger

=subfield(GetFieldSelections(EmployeeName),',')

However this expression only selects the first value in the alphabetical order of selections. I want to force the trigger to only select the value that was selected in last and clear the other values.

I am using this trigger and not the always one selected value property because I want to clear this property when I move to other sheets

Arif

5 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

You can make the list box to always one selected.

Which is there in the listbox properties-->General-->Check the always one selected

Siva_Sankar
Master II
Master II

Syed,

Looks like the requirement is discussed here. http://community.qlik.com/thread/58278

You can try set analysis or bookmark feature. Check the above mentioned link.

Regards.

Siva

Not applicable
Author

by last, I mean the value that was selected at the end. For example, If you make multiple selections, then the value that was selected last should be selected while the others should be cleared. Bookmark will only take me to previous selections.

What I want is an alternate to always one selected value. I don't want to use the always one selected value property because I want to clear the field when I move to other sheets.

So I want to use the onanyselect trigger and clear the multiple selections and only keep the value that was selected last.

Bookmark will take me to all the selections that were made previously

Regards

Syed

Not applicable
Author

can't use always one selected value property because I want to clear the field when I move to other sheets

Arif

CELAMBARASAN
Partner - Champion
Partner - Champion

Here you need some kind of trigger

Hope below workaround works

Goto Document properties - > Trigger -> Field Event Trigger-->Select a Field "EmployeeName".

Add Action for On Select event-->chose Select in Field Action in the Selection category.

in Field type Field name i.e., EmployeeName

in Search string use

=if(GetActiveSheetID()='Document\SH01', if(GetSelectedCount(EmployeeName) = 0,MaxString({$1} EmployeeName), MaxString(EmployeeName)), '(' & Concat(DISTINCT EmployeeName, '|') & ')')

Assuming that 'Document\SH01' sheet id needs atleast one selected functionality.

But when coming to same sheet again you need to use sheet trigger to do some work around.