
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Part of expression($ sign expansion) doesnot come up while assigning that Qlik expression into variable ( expression and variables are in excel table)
Consider an excel sheet as below, contains 2 columns one for variable name and other for variable expression.
This has to be loaded into qlik and these variables vA,vB,vC has to be created. I have done this using for loop as follows:
vars:
LOAD
VarName,
VarExpression
FROM [lib://new path/variables.xlsx]
(ooxml, embedded labels, table is Sheet1);
for i=0 to NoOfRows('vars')-1;
vVar_name=peek('VarName',$(i),'vars');
vVar_expression=peek('VarExpression',$(i),'vars');
let $(vVar_name)='$(vVar_expression)';
next i;
exit script;
The problem is in the vB variable, within set analysis $(=max(year)) has been used
This wont come into variable, just $<Year={}> with empty { } comes up. How to fix this?
In the above pic it is seen, vB has $<Year={ }> instead of $<Year={$(=max(Year))}>
Note: It is properly allocated in data model.
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oldie but goodie - the same solutions should still apply.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
set $(vVar_name)="=replace('$(vVar_expression)','~','$')";
Just realized that this should work. Won't double the amount of variables.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oldie but goodie - the same solutions should still apply.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great! This method worked fine for me.
But it will just create double the amount of variables by using one variable just for replace function:
set $(vVar_name)="$(vVar_expression)";
set v$(vVar_name)final= "=replace([$(vVar_name)],'~','$')";
Is there any way to get around this? Just curious. Doubling the number of variable might effect performance. That is my concern.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
set $(vVar_name)="=replace('$(vVar_expression)','~','$')";
Just realized that this should work. Won't double the amount of variables.
