Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In a selection object, it is useful to tick the option 'Always One Selected Value'. This means that only one value can be selected at a time.
However, I need to also be able to clear all selections on the field to see all values.
Is there any way to achieve this ?
Thanks
Not aware of a straightforward way to do what you're describing with the Always One Selected Value property checked. However, there are some ideas/workarounds in this thread: https://community.qlik.com/thread/36497
Look for DV solution. Tested and and it's working
How to clear the Always One selected value
As per I know their is not direct method ..we need to use the macro for the same
Ok, try this:
In Settings > Document Properties > Triggers > Field Event Triggers (Highlight the field) > OnSelect Add Action(s).
Click Add > Selection > Select in Field. Enter the field name, then this expression in the Search String.
=SubField(GetFieldSelections(yourfield), ',', 1)
Press OK and you should be done.
Here is a thread for reference: list box - how to force to choose only one value
Hi,
maybe you could adapt one of this solutions to your requirements?:
How to you always select multiple fields in a list box: Qlikview 12
hope this helps
regards
Marco
maybe using one of these expressions as search string in a search in field action at the OnSelect field event trigger of the your field (year in this example):
=If(GetSelectedCount(Year)>1,Only({$1} Year),Only(Year))
=Only($(=If(GetSelectedCount(Year)>1,'{$1}','')) Year)
see attached example
hope this helps
regards
Marco