Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a variable in a String. And I want the String to change when the variable changes.
Let v1 = 1;
Let v2 = 'v1 is $(v1)';
$(v2) --> "v1 is 1"
When I change v1, I want also v2 to be changed:
Let v1 = 2;
$(v2) --> "v1 is 2"
But it doesn't work. It works only the first time I use $(v2). Do you know how to do that?
BR
I think you could use parametrized variables for it - maybe something like this:
let v1 = 'select * from SOURCE where Date >= $1;';
let v2 = '$(v1(''20.12.2017''))';
trace $(v1);
trace $(v2);
- Marcus
Try this: Let v2 = 'v1 is'& $(v1);
That is also not working. Its the same result. The string is only evaluated once 😕
How do you call the variable - with $(v2) or with '$(v2)' and where?
- Marcus
I tried both $(v2) and '$(v2)'. I'm using the variables in the data load script.
try the below statement:
Let v2 = '=v1 is ' & $(v1);
on the UI use v2 without dollar expansion $.
How do you check the content of the variables? Did you try:
trace $(v1);
trace $(v2);
trace '$(v2)';
- Marcus
It is also not working:
Let v1 = 1;
Let v2 = '=v1 is ' & $(v1);
Trace($(v2));
Let v1 = 2;
Trace($(v2));
Trace($(v1));
Trace($(v2));
Trace('$(v2)');
-->
(2)
(v1 is 1)
('v1 is 1')
what do you get on the UI creating a Text object with expression =v2 ?