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: 
Not applicable

ListBox - Always at least one Selected Value needed (not Always One Selected Value)

I want to have my Listbox (Qlikview 10.0 SR2) have the behavior or allowing many selections but always have at least one selected.  I am aware of the Property "Always One Selected value", but this is not the behavior I want.  I want "Always One or more selected values".  How can I acheive this?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You could use triggers in Settings - Document properties for a Field Event (OnChange and OnSelect) to achieve this.

For example, if your field is Month, select Action Select - Select in Field with field

Month

and as search string

='('&if(GetSelectedCount( Month )=0,month(today()),GetFieldSelections( Month,'|' ) )&')'

This will have always one or more values selected (if you clear the selection, the month of today is selected).

View solution in original post

5 Replies
swuehl
MVP
MVP

You could use triggers in Settings - Document properties for a Field Event (OnChange and OnSelect) to achieve this.

For example, if your field is Month, select Action Select - Select in Field with field

Month

and as search string

='('&if(GetSelectedCount( Month )=0,month(today()),GetFieldSelections( Month,'|' ) )&')'

This will have always one or more values selected (if you clear the selection, the month of today is selected).

Not applicable
Author

This is a great solution.  Thanks for the help!

Anonymous
Not applicable
Author

Nice Solution.

jessica_webb
Creator III
Creator III

Hi swuehl,

This is just what I'm looking for, but I'm struggling to apply it to my measures.

The field is called 'Location', and I would like it to default to 'London'.

So I'm trying:

='('&if(GetSelectedCount( Location)=0,'London'),GetFieldSelections( Location,'|' ) )&')'


But that doesn't seem to be right.



Are you able to advise?
Many thanks.

swuehl
MVP
MVP

Jessica,

I think you need to remove the closing bracket after 'London':

='('&if(GetSelectedCount( Location)=0,'London',GetFieldSelections( Location,'|' ) )&')'