Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
If you are a Qlik Insight Bot user, join this collaborative group: JOIN GROUP
Highlighted
Not applicable

Always One Selected - Defaults

Quick question on AlwaysOneSelected for List boxes - How does Qlikview decide which value to use as a 'default' when the 'clear all' button is used? I am experiencing some unwanted dashboard behavior where when 'clear' is hit, values in list boxes marked 'always one selected' are reverting back to previously selected values, whereas I would like their selected value not to change at all (or to change to the most recent month, whereas the month is stored as a three-part text field.).

I've read about the OnActivateSheet trick, and that seems like it could help, but it wouldn't solve users' confusion when their time period is being changed every time they hit 'Clear'.

1 Solution

Accepted Solutions
Highlighted
Not applicable

Re: Always One Selected - Defaults

Aha! I found it - all of the programmatic methods were very interesting, but a little bit unnecessary for what I wanted. I eventually poked around in the toolbar. The "clear" button has a drop-down underneath that has an option called 'Set Clear State' as well as a corresponding 'Reset Clear State'. Apparently, what 'Set Clear State' does is memorize the default values that you want it to clear to, so you can have it clear to a given set of selections rather than clear everything. Unfortunately, there's no way of telling if a coworker has done this, and then left on vacation... With the Clear State reset, everything is working as intended. Thanks for your help!

View solution in original post

7 Replies
MVP
MVP

Re: Always One Selected - Defaults

Google QlikShare.com and search

Customer OnClearAll Document Event in QlikView

Highlighted
Not applicable

Re: Always One Selected - Defaults

Interesting video. Unfortunately, it seems to rely on setting up a bookmark to be used as a 'home' state to undo the changes imposed by the clear. I would prefer to use a solution that does not cause me to have to go in and manually save a new default state every month. If the default state were not changing every month, then this would be a perfect solution.

Highlighted
Not applicable

Re: Always One Selected - Defaults

Trying with Trigger Action on "On Any Select" Doc Properties.

Highlighted
Not applicable

Re: Always One Selected - Defaults

Hmm. Wouldn't that just reset the field any time someone tried to change it (or any other field)? I don't think that would be ideal, because I do want it to be changeable, just to change to where I want it to change when "Clear" is hit.

Highlighted
Not applicable

Re: Always One Selected - Defaults

Hi Kevin,

You can try to create a new table with single field value with max(month(required_date)) and use this field to create a hidden list box with property set as 'Always one selected value'.

Let this field join the main data model's month field, since there will be only one value in this field,

data associated to recent month will be available.

MAX_Month:

LOAD MAX(Month([Required Date])) as Month // this field can be joined to Month in main data model

Resident Fact;

Else

As dathu has suggested you can add a trigger "On Any Select" for the required field to set the interested value.

Hope this helps...

Highlighted
Not applicable

Re: Always One Selected - Defaults

That should be doable on Action. Try Your expression on Select Filed action:

IF(getselectedCount(FieldName) ,  Fieldname), Only({<$1>}FieldName)

Highlighted
Not applicable

Re: Always One Selected - Defaults

Aha! I found it - all of the programmatic methods were very interesting, but a little bit unnecessary for what I wanted. I eventually poked around in the toolbar. The "clear" button has a drop-down underneath that has an option called 'Set Clear State' as well as a corresponding 'Reset Clear State'. Apparently, what 'Set Clear State' does is memorize the default values that you want it to clear to, so you can have it clear to a given set of selections rather than clear everything. Unfortunately, there's no way of telling if a coworker has done this, and then left on vacation... With the Clear State reset, everything is working as intended. Thanks for your help!

View solution in original post