Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Partner - Master
Partner - Master

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.

View solution in original post

5 Replies
Anonymous
Not applicable
Author

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
Partner - Master
Partner - Master

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
Partner - Master
Partner - Master

And a qvw that demonstrates this attached

Not applicable
Author

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
Partner - Master
Partner - Master

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.