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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
deepakqlikview_123
Specialist
Specialist

how to set listbox selection for maximum of 2 perticular selection

how to set listbox selection for maximum of 2 perticular selection

7 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

There is no built-in property to limit the selection to two possible values. The only way to do this is on add actions to the OnChange and/or OnSelect triggers for that field.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Kushal_Chawda

You can do something like this using Field event trigger

Please see the attached

Anonymous
Not applicable

Hi,

Yes, as Jonathan said, there is no built in property to limit the selection to two possible values. You can use triggers

MayilVahanan

hi

May be try like this

Document Properties -> trigger -> Field Event Trigger -> Field name -> OnSelect

Actions:

Select in Field

Field: FieldName

=if(GetSelectedCount(FieldName)>2, '', '(*' & GetFieldSelections(FieldName,'*|*') & '*)')

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
avinashelite

you can try like this:

Go to list box properties >layout > here you can specific if the count is more than 2 disappear the listbox and show a text box message to select only two at a time>you can add action in the text so that it will clear the selection in the list box and the list box will appear for the fresh section

deepakqlikview_123
Specialist
Specialist
Author

hi,

thanks,Can you please suggest where you have added the action i am not able to find it.

thanks

Anonymous
Not applicable

Hi,

Go to Settings>Document Properties>Triggers>Field Event Triggers>Select Fieldname>OnSelect>Add Action>Select in Field>Field name>Search String> =if(GetSelectedCount(FieldName)>2, '', '(*' & GetFieldSelections(FieldName,'*|*') & '*)')

Hope it helps!!