Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Avoid Dollar sign expansion when reloading

Hi, does anyone know how to avoid dollar sign expansion during script execution???, for example, I want to declare a variable in the script like this:

set x = "sum({$<Field = {$(var)}>} Amount)";

I want the value to be set literally in the variable, without expanding $(var).

Any ideas?

Thanks in advance.

Regards

1 Solution

Accepted Solutions
Not applicable
Author

Hi

Not sure if the above works, because I find that you have to use LET rather than SET to avoid the dollar expansion during reload, the LET command means "put this exact text into a variable" whereas SET will often evaluate at least part of the command (including dollar expansion).

Also, I have found that on the dollar expansion side of things, I need to use a chr() command to ensure it works, so I would make the statement as follows:

LET x = 'Sum ( { $ < Field = {"' & chr(36) & '(var)} > } Amount )';


Chr(36) is obviously the dollar sign!

Good luck,

View solution in original post

5 Replies
Not applicable
Author

have you tried splitting the expression into two and concatanating into the variable, e.g.


set x = "sum({$"&"<Field = {$(var)}>} Amount)";


Not applicable
Author

Hi

Not sure if the above works, because I find that you have to use LET rather than SET to avoid the dollar expansion during reload, the LET command means "put this exact text into a variable" whereas SET will often evaluate at least part of the command (including dollar expansion).

Also, I have found that on the dollar expansion side of things, I need to use a chr() command to ensure it works, so I would make the statement as follows:

LET x = 'Sum ( { $ < Field = {"' & chr(36) & '(var)} > } Amount )';


Chr(36) is obviously the dollar sign!

Good luck,

brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi,

pardon Nigel, but you forgot the quotes at the end:

LET x = 'Sum ( { $ < Field = {"' & chr(36) & '(var) "} > } Amount )';

Not applicable
Author

Hi Martina

Well spotted!

Apologies for that one.......

Not applicable
Author

Thank you so much Nigel and Martina. I thought it was imposible.

Regards,

Ivan