Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
yogitamehta10
Creator
Creator

Qliksense variable file

Hi ALL,

i'm trying to maintain a file for variable in Qliksense , but when i run this script  .

 

 

i get this error

 

 

 

 
The following error occurred:
Unexpected token: 'Rate', expected: '='
 
The error occurred here:
let vFormConversion >>>>>>Rate<<<<<< = peek('Expression', i, 'Temp_Variables') & chr(10) & '/* NA */'
 
 
 
SCript i'm Using 
 

Temp_Variables:
LOAD Name,
Expression,
Comment
FROM [lib/expressions1.xlsx]
(ooxml, embedded labels, table is Sheet2);

 

// Create variables
for i = 0 to NoOfRows('Temp_Variables') - 1

let vName = peek('Name', i, 'Temp_Variables'); // Name of the variable
let vComment = peek('Comment', i, 'Temp_Variables'); // Comment/description of the variable
let $(vName) = peek('Expression', i, 'Temp_Variables') & chr(10) & '/* $(vComment) */'; // Expression

next i


// Remove temp variables
let i = null();
let vName = null();
let vComment = null();

// Remove temp tables
drop table Temp_Variables;

 

 

any idea please

 

TIA

 
3 Replies
jensmunnichs
Creator III
Creator III

Seems to me like your list of names has a value with a space in it, which would break the LET statement.

EDIT: The value being 'vFormConversion Rate', if that wasn't clear.

yogitamehta10
Creator
Creator
Author

Thanks ..

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You generally shouldn't have spaces in your variable names, but you can tolerate it by adding brackets around the variable name in the script:

let [$(vName)] = peek('Expression', i, 'Temp_Variables') & chr(10) & '/* $(vComment) */'; // Expression

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com