Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
just a quick question: When I have a set_expression that I would normally have to copy-paste into all my formulas, approx. 100x in total, can I put that in a variable instead?
How would that have to look?
Can I use it using the $-sign expansion?
Thanks a lot!
Best regards,
DataNibbler
Yes you can put the expression in a variable and yes you need to dollar-expand it where you use the variable.
variable vSum: sum({<Year={2014}>}Amount)
expression using the variable: $(vSum)
Yes you can put the expression in a variable and yes you need to dollar-expand it where you use the variable.
variable vSum: sum({<Year={2014}>}Amount)
expression using the variable: $(vSum)
Hi,
Yes, normally you can put any part of expression in a variable.
For example you can put 'Year={2014}, MonthNum={3}' in vBaseSet
And then use in expression: Sum({<$(vBaseSet)>} Value) or Sum({<$(vBaseSet), Day={1}>} Value).
Even if the speller fails it doesn't mean that expression is incorrect.
The drawback is that later to understand the expression you have to know the variable value.
Also, sooner or later you will have problems with quotes like Dim={'Value'}, sometimes it fails with no reason.
You can even try $-sign expressions with parameters...