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

How to pass a value of a variable between the macro and the load script

Hello all,

I created a list box called 'site' and I want to take the last value selected in it.

I created a macro with a function which contains :

Function test()

     Set myvariable = ??? (I want to have the last value selected in the list box)

End Function

And in my load script I called the function :

Let myvariable = test()

If somone can help me !

Thanks.

1 Reply
Not applicable
Author

I believe the function you are looking for is the GetFieldSelections

from the help text:

GetFieldSelections( fieldname [, valuesep [, maxvalues=6 ]] )

returns a string containing the current selections in a given field. Valuesep is the delimiter between selected values and defaults to ', '. Maxvalues is the highest number of individual values that will be displayed before 'x of y' notation is used instead.

Examples:

getfieldselections(Country)
getfieldselections (Country, ';' )
getfieldselections (Country, ',' , 10 )