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

Ability to select multiple values via Input Box

Hi - I would like to provide the ability to enter/select multiple values via an input box. Is there a way for a user to enter multiple values as input?

The values for the input box are restricted to a particular field .

The input value is in-turn passed as value for a variable in an expression.

Example:  For a field such as Year, I would like my user to be able to select 2009, 2010, and 2011. These values are in-turn passed as values for a variable in an expression.

Thanks in advance for your help.

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi,

Variables can only store one value at a time, but if you are going to pass them to, say, set analysis, you can allow the user to input several comma separated values that will be read OK in the expression, for example:

vVariable = 2010, 2011, 2012

will pass on to a set analysis expression like

Sum({< Year = {$(vVariable)} >} Amount)

to be expanded to

Sum({< Year = {2010, 2011, 2012} >} Amount)

which is correct and will work. The same will work with text values if properly quoted.

But you need to allow the user to edit the expression and enter values, meaning you cannot create a drop down list of values and let the user select more than one at a time.

Hope that helps.

Miguel

View solution in original post

2 Replies
Miguel_Angel_Baeyens

Hi,

Variables can only store one value at a time, but if you are going to pass them to, say, set analysis, you can allow the user to input several comma separated values that will be read OK in the expression, for example:

vVariable = 2010, 2011, 2012

will pass on to a set analysis expression like

Sum({< Year = {$(vVariable)} >} Amount)

to be expanded to

Sum({< Year = {2010, 2011, 2012} >} Amount)

which is correct and will work. The same will work with text values if properly quoted.

But you need to allow the user to edit the expression and enter values, meaning you cannot create a drop down list of values and let the user select more than one at a time.

Hope that helps.

Miguel

Not applicable
Author

Thanks Miguel. That sure does help.