Discussion Board for collaboration related to Creating Analytics for QlikView.
e.g. I have two script lines:
set fSel_1=(COEP.GJAHR='$(vYr_1)' AND COEP.VERSN='$(vVersion_1)' AND COEP.WRTTP='01');
set fPlanJahr =Sum (if($(fSel_1),COEP.WKGBTR,0));
and I want the string as it is "Sum (if($(fSel_1),COEP.WKGBTR,0))" for fPlanJahr
but QV replaces $(fSel_1) by the variable content of fSel_1
How can I force QV to handle the right side as a string without replacing?
Why? Because vYr_1 and vVersion_1 shall be changed by user input and the variables-hierarchy shall be interpreted during interactive reporting.
When using the variable editor it works fine, when creating them by script i miss the solution.
set xxx = [Sum (if($(fSel_1),COEP.WKGBTR,0))];
set xxx = "Sum (if($(fSel_1),COEP.WKGBTR,0));";
best regards Eckhard
try something like
let fPlanJahr ='Sum (if('&chr(36)&'(fSel_1),COEP.WKGBTR,0))';
Another option is to use a different character to denote the variable and replace the character with the dollar sign. For example:
SET fSel_1=(COEP.GJAHR='@(vYr_1)' AND COEP.VERSN='@(vVersion_1)' AND COEP.WRTTP='01');
LET fSel_1=replace(fSel_1, '@', '$');
I find that this is more readable especially you have many variables were you don't want the dollar-sign expansion to occur.
Hi, bothe helped me.
In the end I have something like
// , replaces Komma
// " replaces '
// [ replaces (
// ] replaces )
The resulting code is:
set fMonSel_1=[$[fSel_1] AND COEP.PERIO="$[SelPERIO]"];
Its not fine but the only way i found in a deep hierarchy of formula