Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Need to select a set of values in a list box, using a button action.

Here's the list of values in the list box (or field)

YTD,

MTD,

Jan,

Feb,

Mar,

..

..

..

Dec

I created a button to help the user select all the months at one go - Toggle select.

Field_name: AdhocCols

String: (Jan|Feb|Mar|Apr|May|.........|Dec)

This works fine only if the user hasn't already selected one of the months in my list. If he has selected YTD, MTD, Jan & Feb already, then my button deselect Jan & Feb.

Please help. how do I make the button disregard the current selections in that field.

21 Replies
Anonymous
Not applicable
Author

Thanks Miguel! Let me try this out

Anonymous
Not applicable
Author

Gonna try this out thank you so much for this. Will update shortly.

Anonymous
Not applicable
Author

This didn't work

I added this in the search string but the button action does nothing.

Anonymous
Not applicable
Author

No Susovan this didn;t work. The whole prob is this - selecting all the months happens using your method but it deselects the user selections that already exist. In my case I want to select the months in addition to the YTD, MTD etc. selections.

Miguel_Angel_Baeyens

It does work for me. You will need to change the field name to whichever is yours, likely.

Anonymous
Not applicable
Author

Thanks! Let me see why it isn't working in my app. Will update shortly.

Anonymous
Not applicable
Author

Yay! Thank you Miguel. I had missed to replace field name

Anonymous
Not applicable
Author

One question though - when I use this, the current selection field shows multiple values for months. How can I avoid that?

Miguel_Angel_Baeyens

You cannot, the current selection object displays whatever selection is made in the current document. If you select them manually the appearance will vary (e.g.: you don't need to use "(" or "|") but the result is the same.

Miguel_Angel_Baeyens

Cannot edit so reply to myself for further clarification:

  1. If you mean every month appears twice, it is correct, one is the selected value by the user the other is the string you use in the Search In String
  2. If you mean you see the (Jan|Feb|...) in the selection box is also correct. If you manually type this expression in the listbox search function, you will select indeed these values.