Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

get value of variable in script

Hey Guys

I have a question for yours

i need read a variable from a load something likes this

"

LOAD [Group],
Name,
Frequency,
Tipe,
sheet1 //+++++this a read variables
FROM C:\Repository\frecuency.xls (biff, embedded labels, table is Hoja1$)
WHERE(Name)='$(File)';

var = sheet ; //+++++must be read value of variable

"

When i run this test , return a null value

Any help please !!!!!!

Thanks

4 Replies
Not applicable
Author

Now sure if it is just a typo, but you load field 'sheet1' and set the variable to the content of field 'sheet'.

Not applicable
Author

Hi Mark thanks for answer so soon

Yes a try to set content of the field 'sheet1' in to variable var

Thanks in advance

Not applicable
Author

You won't be able to fill one variable with all the content of field 'sheet1', since that field will probably contain more than one value. A variable can only contain one value at a time.

Anonymous
Not applicable
Author

If sheet1 has the same value for every row or if you want to pick a specific row value from sheet1 you can use peek() to pull it into a variable:

Let vVariable = peek('sheet1',-1,'TableName');

The second parameter is set to -1 which means the very last row. 0 is the first row and n is the n:th row. Any negative value starts from the bottom of the table and goes backwards. Hope this makes sense.