Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a number of expressions in my document that I am using repeatedly, so I wanted to load them into variables.
First I defined them in the document using the Variable Overview and that works perfectly.
Best practices recommends loading them in the script, so I attempted to do that, but have had no luck getting it to work.
This is what Variable Overview shows if I define it in the document:
eCurrentYear = sum({$<@Year={$(=(@Year))},@Quarter = ,@Period = ,@Week = >}#InvoiceTotal)
eLastYear = sum({$<@Year={$(=(@Year)-1)},@Quarter = ,@Period = ,@Week = >}#InvoiceTotal)
Life is good!
This is what Variable Overview shows if I define it in the script:
eCurrentYear = sum({$<@Year={(internal error)},@Quarter = ,@Period = ,@Week = >}#InvoiceTotal)
eLastYear = sum({$<@Year={(internal error)},@Quarter = ,@Period = ,@Week = >}#InvoiceTotal)
Does anybody have any idea what's causing the internal error, and how to get around it?
Finally got it working, based on a previous post in the Community by Sunny Talwar.
LET etCurrentYear='sum({$' & '<@Year={$' & '(=(@Year))},@Quarter = ,@Period = ,@Week = >}#InvoiceTotal)' ;
LET eLastYear='sum({$' & '<@Year={$' & '(=(@Year)-1)},@Quarter = ,@Period = ,@Week = >}#InvoiceTotal@)' ;
I just needed the ' & ' after the $ signs. It now works as expected.