Can you please tell against which dimensions you have wrote this expressions?
If [Client Number] is your dimension then you can write it as below -
Load [Client Number],
I have not tried it but it should work. Please confirm.
Hope this will be helpful for you.
Prashant P Baste
Before you start scripting, start thinking about the granularity you'll need.
An expression in a chart is in general sensitiv to user selections (e.g. in Client Number).
If you want to replicate the chart expression in the script, you would need to use an aggregation grouped by the chart's dimensions, filtered by any condition / set expression used in your chart expression, which can be VERY demanding.
You would need to repeat this for EVERY POSSIBLE user selection that your chart will respond to (except for few cases where your expression is insensitive to user selections. Your above sample is sensitive).
I believe the complexity of your script calculation and execution time will overweigh the benefit of precalculating the values in the script.