Qlik Community

Ask a Question

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
Showing results for 
Search instead for 
Did you mean: 
Not applicable

variable definition in Qlikview loadscript


I want to define a variable in Qlikview loading script and want to use the expression in the variable inside Qlikview charts. The variable is like this

Set f_CreateSheetId    =    "$1 & PURGECHAR($(=$1 & 'FrontMenu' & $2), ' ')";

I want the expression as it is inside Qlikview. I do not want the expression or any part of the expression to be evaluated in the load script. However, the load script evaluates the part $(=$1 & 'FrontMenu' & $2) in the expression

I have tried using both Let and Set but none of them works. Any idea how to fix this?


5 Replies
Creator III
Creator III

Try this ,

let f_CreateSheetId    =    "$(1) & PURGECHAR($(=$(1) & 'FrontMenu' & $(2)), ' ')";



Try this----Write in single quote-----

Set f_CreateSheetId    =    '$1 & PURGECHAR($(=$1 & 'FrontMenu' & $2), ' ')';


Set f_CreateSheetId    =    _1 & PURGECHAR(_(=_1 & 'FrontMenu' & _2), ' ');

LET f_CreateSheetId = replace('$(f_CreateSheetId)','_',chr(36));

Master III
Master III

let f_CreateSheetId = '$'&'1 & PURGECHAR($'&'(=$' &'1 & ' & chr(39)&'FrontMenu'& chr(39)&'&' & ' $'&'2),'& chr(39)&' '& chr(39)&')'; 

Not applicable

This seems to work but I have two problems. I have an equal sign at the start of the expression that I forgot to mention earlier so the expression is like below

Set f_CreateSheetId    =    "=$1 & PURGECHAR($(=$1 & 'FrontMenu' & $2), ' ')";

Somehow, I am struggling to escape the equal sign

secondly, I have around 70 expressions like these so it would be good to come up with a generic change that would work for all the expressions that have either equal sign or dollarsign expansion like =$(