Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

save selection into variable

Hi

How do i save the selection of a table into a variable?

5 Replies
Not applicable
Author

Hi elint10110

You can do this By using Micro

for example ,if you have MyVar defined variable and you want to store last current selected value in this variable then







Sub

CurrentSelection



set

X=ActiveDocument.GetCurrentSelections



S=X.selections

V=X.VarId







For

i=lbound(S) to ubound(S)



ActiveDocument.Variables(

"MyVar").SetContent S(i), true

next

End

Sub















By using this micro you will get current selected value in the variable MyVar

And other related information please go through API topics(Get Selected Values and Variables )

Hope this will help you









Anonymous
Not applicable
Author

That micro, where should be located??? in the script editor?

Anonymous
Not applicable
Author

Hi

     Create one variable in your dashboard and assign the following function in the variable

Your variable = =GetCurrentSelections()

Regards

Ashok

Anonymous
Not applicable
Author

Hi

     Please remove on assignment operater '=' from previous post

Regards

Anonymous
Not applicable
Author

Hi

     Using the

         

   Variable name       =GetFieldSelections(YourFieldName)  you can specifically stored particular field selected value in the variable

Regards