Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
becki_kain
Contributor III
Contributor III

set two variables from one list box?

i looked at this  Capture ListBox Selections in separate variables | Qlik Community but how do i set two variables - time_period_1 and time_period_2, from the same drop down list box?  i want the use to pick one, and set that to time_period_1 and then pick another and set to time_period_2, but within the same drop down.  can this be done?  thanks


becki kain

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Can you share an example of what selections you make?

use like

time_period_1 variable have the expr like

= Subfield(GetFieldSelections(fieldname, ','), ',', 1)

time_period_2 variable have the expr like

= Subfield(GetFieldSelections(fieldname, ','), ',', 2)

View solution in original post

7 Replies
vishsaggi
Champion III
Champion III

Can you share an example of what selections you make?

use like

time_period_1 variable have the expr like

= Subfield(GetFieldSelections(fieldname, ','), ',', 1)

time_period_2 variable have the expr like

= Subfield(GetFieldSelections(fieldname, ','), ',', 2)

ravikumar_iyana
Creator
Creator

Hi,

In List Boxes have

Properties-> Constrains-> Listed Values-> Only Selected Values Display-> There you can mention

Then it will be displayed

becki_kain
Contributor III
Contributor III
Author

I have a list box with a bunch of values in it. I want to set a variable of time_period1 to the first thing the user clicks on, in this list box, and a variable of time_period 2 of the second thing.  where, in that example, are you setting the variables?  thanks

vishsaggi
Champion III
Champion III

Click Ctrl+Alt+V you can see a variable window there add these expression for two variables.

Capture.PNG

becki_kain
Contributor III
Contributor III
Author

that was what I was missing - you have to add the variables first.  I will try it with one input, then get crazy and try with two!

(yes, my first workflow in qlik!)

vishsaggi
Champion III
Champion III

Sure. Else share your app which you are working on i will try to create and explain you accordingly.

becki_kain
Contributor III
Contributor III
Author

thank you!  works perfectly!  (yes, my coworker warned me qlik has a huge learning curve!)