Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

keep the selected value of a listbox in a variable

Hi,

Is it possible to keep the selected value of a field of a listbox in a variable (document variable, SET v_periodo = ....)?

I suppose is selected only one item in the listbox

Thanks

5 Replies
alexandros17
Partner - Champion III
Partner - Champion III

use =GetFieldSelections(field) function

qlikmsg4u
Specialist
Specialist

Use GetFieldSelections function

Create a variable like this

Let vVar1 = =GetFieldSelections(Your Field)

jonathandienst
Partner - Champion III
Partner - Champion III

That will return null - the statement should be

Set vVar1 = =GetFieldSelections(Your Field);

or

Let vVar1 = '=GetFieldSelections(Your Field)';

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
qlikmsg4u
Specialist
Specialist

My bad thanks for pointing,

I just wrote down with out thinking much

Peter_Cammaert
Partner - Champion III
Partner - Champion III

There are a number of solutions to this problem. Their effectiveness depends on the situation and on what you plan to do with them. See this picture. Every script variable should be set to the text of an expression, preceded by an equal sign. By preference, use the SET statement.

Keep Listbox value in variable thread182014.jpg

The first example allows you to define separators yourself (plus, minus, whatever). The fourth example is very useful when you want to set the variable to another value associated with the current selection in your listbox (using set analysis).

Peter