Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Felipe02
Contributor III
Contributor III

Create variable from a table value

Gentlemen, is it possible to place the value of a table in a variable?

I need to use an existing value in a table, and it does not have a connection link with other tables in the application.

1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

HI, 

since it is a table from your data model you can just load it during load script. 

Let vYourVariable = Peek('YourField', 0, 'YourTable'); // 0 is a first row in that table 

If your table has many rows and you want users to pick value from UI by selecting single value in your table you can just use "=Only(YourField)" or "'MaxString(YourField)" or similar (depending what your value actually is) formula which will make it dynamic to user selections.

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

3 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

HI, 

since it is a table from your data model you can just load it during load script. 

Let vYourVariable = Peek('YourField', 0, 'YourTable'); // 0 is a first row in that table 

If your table has many rows and you want users to pick value from UI by selecting single value in your table you can just use "=Only(YourField)" or "'MaxString(YourField)" or similar (depending what your value actually is) formula which will make it dynamic to user selections.

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Felipe02
Contributor III
Contributor III
Author

Thanks friend, this solved my problem!

Justin-Katz
Contributor
Contributor

How would you do this if the source was a table in the UI? Is it possible?