Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
benazirkhan
Contributor II

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.

Tags (2)
1 Solution

Accepted Solutions

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

Use the Concat() function to include the already selected values, something like:

='(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dic|' & Concat(DISTINCT Field, '|') & ')'

In the Search String will take whatever is already selected plus all the months. If any month is already selected, it will not change.

So if the user has MTD and Feb, clicking the button with this function should select all months plus the MTD which was already selected.

21 Replies
Khan_Mohammed
Honored Contributor II

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

Direct selection in filter would clear all selections made by button.

I can only think of user holding 'Ctrl' key to select other fields too...as randomly selecting multiple fields.

benazirkhan
Contributor II

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

I don't think that's how it works. Consider there's just the listbox and a button. If a user makes a few selections in the listbox after clicking the button, the button selections do not clear away.

If the user selects YTD and MTD then click on my toggle select button for all months, all months get selected - another click of the button - the months (only the months) get deselected.

Only prob however - if the user has selected YTD, MTD, Jan, Feb then clicks the toggle button - Jan and Feb get deselected. Rest of the months get selected along with YTD and MTD.

benazirkhan
Contributor II

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

bump! Can someone please help me with this?

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

Maybe you need to add a Clear Field action before the Select in Field? Then, every time you click on the button all specified values will be selected, regardless what was already selected by the user.

benazirkhan
Contributor II

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

Thanks Miguel! But unfortunately, I want my Month selections to happen in addition to the existing selections made by the user. All these values YTD, MTD, Jan....Dec are all in the same field.

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

Sorry, I'm missing something: you have a field AdhocCols with the values

YTD,MTD,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec

And only these values.

The user can select whatever value from that listbox, and you want to provide them with a button to select ALL values, the use a simple star * in the Search String and always all values will be selected, regardless the selection. After a second thought, though, I don't know if this is the case why do you need the button at all, if the user can simply drag and drop in the listbox and select all values.

If my understanding is not correct, specify with your actual application the name of the fields, their values and the use case of such button (eventually with a sample app we can work with).

benazirkhan
Contributor II

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

Thanks for your reply Miguel. My mistake I should've given you the actual LOV

YTD

LYTD

MTD

LYMTD

LY-1MTD

LY-2MTD

LY-3MTD

LY-1YTD

LY-2YTD

LY-3YTD

Jan

Feb

Mar

Apr

May

.

.

.

.

Dec

Now the user wants just one button to select ALL MONTHS in addition to the existing selections he has made. If I clear field, I stand to lose the selections already in place. The toggle action works very well - except the fact that if the user has already selected a few months, those get deselected when the button is clicked.

Thank you so much for taking out time.

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

Use the Concat() function to include the already selected values, something like:

='(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dic|' & Concat(DISTINCT Field, '|') & ')'

In the Search String will take whatever is already selected plus all the months. If any month is already selected, it will not change.

So if the user has MTD and Feb, clicking the button with this function should select all months plus the MTD which was already selected.

Partner
Partner

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

Hi,

You will be get the requisite after double click on the button.

PFA