Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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,
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.
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
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,'|')&')'
And a qvw that demonstrates this attached
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
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.