Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Customers, Partners & Luminaries only: You're invited to a Data Analytics Roadmap session. Read More
Showing results for 
Search instead for 
Did you mean: 

How to Clear 'Always One Selected Value' ?

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 ?


6 Replies
Creator III
Creator III

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

As per I know their is not direct method ..we need to use the macro for the same

Creator III
Creator III

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



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