Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Selected value as variable

Hi *,

is it possible to use the value of a selected field as value.

eg. I have the a year field that contains years from 2000 - 2009.

I'd like to use the select field e.g. 2006 as a variable.

Thanks

3 Replies
Not applicable
Author



I think you can do that in macro

Suppose you have one field ref year value and you want to make receive year same as ref year.

Set Z = ActiveDocument.Fields("Reference Year")
ActiveDocument.Fields("Receive Year").Selectvalues Z.GetSelectedValues()

aslo ref the API guide

Talha





Not applicable
Author

You can also do this in a variable by adding the following to the variable declaration:

=GetFieldSelections("ReceiveYear")

The only potential issue is that it does some rather odd things when more than one selection is made from the same field (when I say odd, it does make sense, but it seems odd).

Regards,

Nigel.

Anonymous
Not applicable
Author

Not clear what exactly you want. If follow your question literally, the answer is to createa variable, e.g. vSelectedYear, and define it as =Year