Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Automatic selection in a list box

Hello experts:

I have a list box with years. I the user selects two non-consecutive years (for example: 2016 and 2019) I need to select automatically, in the same list box, all the years in the middle (2017 and 2018), in addition to those selected by the user. So the selecction will be: 2016, 2017, 2018, 2019.

Any idea?

Thanks,

1 Solution

Accepted Solutions
stigchel
Honored Contributor

Re: Automatic selection in a list box

You're welcome

You also might want to add something to prevent the trigger selecting all years when the user clears the selection like this:

=if(GetSelectedCount(Year)>=1,

'('&Concat({<Year={'>=$(=Min(Year))<=$(=Max(Year))'}>}DISTINCT Year,'|')&')'

)

Also If this has answered your question, please mark the appropriate answers as helpfull\correct. It will let other contributors know this requires no more attention, and other users looking for answers find the correct one.

5 Replies
hrlinder
Honored Contributor

Re: Automatic selection in a list box

qlikview uses Windows behaviour

press shift, goto your first value (2016) and press it, hold shift

goto your second value (2019) and press it

the listbox will select the values 2016 upto 2019

stigchel
Honored Contributor

Re: Automatic selection in a list box

In the Document properties Triggers tab you can set a on select trigger on the field year. For the search string you can use the expression

='('&Concat({<Year={'>=$(=Min(Year))<=$(=Max(Year))'}>}DISTINCT Year,'|')&')'

stigchel
Honored Contributor

Re: Automatic selection in a list box

And a qvw that demonstrates this attached

Not applicable

Re: Automatic selection in a list box

Many, many thanks.

I know that the user can select a range of years by holding shift key, buy I do not want to trust on the user skills; not only about the user of keybard shortcust, but about the meaning of selecting two non-consecutive years in this specific application.

I will try the use of the triggers.

Thanks again

stigchel
Honored Contributor

Re: Automatic selection in a list box

You're welcome

You also might want to add something to prevent the trigger selecting all years when the user clears the selection like this:

=if(GetSelectedCount(Year)>=1,

'('&Concat({<Year={'>=$(=Min(Year))<=$(=Max(Year))'}>}DISTINCT Year,'|')&')'

)

Also If this has answered your question, please mark the appropriate answers as helpfull\correct. It will let other contributors know this requires no more attention, and other users looking for answers find the correct one.

Community Browser