Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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