Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading a field as a variable

Is it possible to set the value of a variable to the value of a field loaded from a qvd?

e.g.

LOAD

field1

FROM

file.qvd;

SET variable = field1;

When I do this the variable returns the text field1 as opposed to the value in field1.

1 Solution

Accepted Solutions
prieper
Master II
Master II

You need to use the PEEK-command, like

SET variable = PEEK('field1', 0, 'MyTable')


This would load the first record, you may sort the table accordingly or create a special table with MIN- or MAX-values.

HTH
Peter

View solution in original post

3 Replies
prieper
Master II
Master II

You need to use the PEEK-command, like

SET variable = PEEK('field1', 0, 'MyTable')


This would load the first record, you may sort the table accordingly or create a special table with MIN- or MAX-values.

HTH
Peter

Not applicable
Author

Thank you.

Not applicable
Author

Hi Peter,  I am using the LET variable = PEEK('field1', 0, 'MyTable') syntax for a field that has only one value and row.  For some reason it is not giving a value for the variable.  Am I missing something?