Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

yogitamehta10
Contributor

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
Contributor III

Re: Qliksense variable file

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
Contributor

Re: Qliksense variable file

Thanks ..

MVP & Luminary
MVP & Luminary

Re: Qliksense variable file

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