I have the following sameple LOAD script, where I am loading amounts in 3 currencies. I want to allow the user to select the currency being reported by selecting the ReportCurrency value in a list box (with Always One Selected Value set).
Main reason is beacuse this is a simplified version of my actual script which has several different types of measure in. They are all suffixed with either usd, eur or gbp and I want to allow the user to choose which currency equivalent to choose to display and any experssions will then dynamically change.
Havign separate variables wouldn't allow this switching between currency equivalents.
I could't find the solution exactly you want, but something I have.
Probably the problem is in Sum function. May be Table and Chart Expression do need this function to be written separately. In this version you need one variable, what will create the name of the field you need: e.g. vReportCurrency with value ='amount_'&Only(ReportCurrency)
Then in Expression use:
As you can see, in this solution you don't need the problematic variable Vol = '=SUM(amount_'&Chr(36)&'(=ReportCurrency))'
Not as frexible as you want, but still some flexibility exists