Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everybody,
I'm in trouble with variables. I would like to load both chart expressions and set expressions in load script,
smth like this:
set vSet=2; // or 1, or '<=3';
set vExpr=sum({$<klient ={$(vSet)}>} käive);
Then the variable vSet should change it's value according to user selection- f.e. klient=1, 2 , less than 3.
The variable change has to be made by button or other action, not field selection. Variable vSet can if fact contain some kind of syntax as well, as its value will not be directly visible to user.
The problem is - when i enter vExpr into Variables Overview window, and create the input box with vSet, it works as needed, i can enter 1,2 or '<=3'.
But when i load the same expr from load script, it evaluates $(vSet) at load time and writes f.e value 1 into the expression.
so i get
sum({$<klient ={1}>} käive) as vExpr.
I tried all possible combinations of syntax but it gets evaluated, and later changes in vSet value from UI do not change the expression and chart. Can someone point me to the right direction, plz!
Just a thought, but what if you try this?
Let vExpr1 = Replace('Sum({$<klient={@(vSet)}>} käive)', '@', Chr(36));
May be this:
set vSet=2; // or 1, or '<=3';
set vExpr=sum({$<klient ={@(vSet)}>} käive);
set vExpr2 = Replace($(vExpr), '@', Chr(36));
Thanks,
i got it work like this:
set vSet=1;
set vExpr1 = "sum({$<klient={@(vSet)}>} käive)";
let vExpr = replace(vExpr1,'@',Chr(36));
but it takes 2 lines in script and 2 variables where i have 20+ expressions and growing, sharing the vSet but different expressions. Perhaps it is possible to reduce it to 1 variable?
Just a thought, but what if you try this?
Let vExpr1 = Replace('Sum({$<klient={@(vSet)}>} käive)', '@', Chr(36));
yep. Than you.
I spent 2 days on this.
Perhaps someone knows the shorter way?
Hahahaha no problem
I am glad I was able to help.
Best,
Sunny
i solved with:
Let vExpr1 = 'Sum({$<klient={'&Chr(36)&'(vSet)}>} käive)';