Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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).
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).
This is a great solution. Thanks for the help! ![]()
Nice Solution.
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.
Jessica,
I think you need to remove the closing bracket after 'London':
='('&if(GetSelectedCount( Location)=0,'London',GetFieldSelections( Location,'|' ) )&')'