Let me break it down:
I have a Straight table chart. The Chart contains 5 complex expressions. I now want to use the expressions to create a new expression. The problem is that the existing expressions' labels are also expressions for example: "=max(Year)&' YTD Sales'".
Instead of me having to copy and re-use the 'expression scripts' from the existing expressions, I want to use a label, id or some sort of name for the existing expressions so that I can create a new expression.
For example: If I have 2 existing expressions named 'Sales' and 'Qty', I can now go and create a third expression 'Sales Price' and use the existing expressions' names for the calculation in the third Expression:
Because, in the chart that I am busy with currently, the expression labels are also expressions, I can't seem to use the same logic.
So I am looking for another way to identify an existing expression, something like column1 or expression1, or an ID of some sort.
Does something like that exist?
I would recommend that you use Erich's suggestion since it is a bit more sofisticated, and adds more control to what you are doing.
However there is a function called Column() that you can use in order to get column values.
Returns the value found in the column ColumnNo in a straight table or a pivot table.
I'm not sure if I understood you too, but maybe you need something like this.
Go to settings, expression overview and create a new variable there:
for this variable you write the expression you want:
Then, you use the expressions you create on your chart by evaluation this
The expression on your chart will be:
This way, after you create may variables, you can just create more complicated formulas:
=$(vExpression1) + $(vExpression2)- ($(vExpression3) /$(vExpression4)
Hope it helps,
EDIT: You may also create expressions for your labels
vLabel1 = max(Year)&' YTD Sales
Then on the expression label box write: =$(vLabel1)
You can use variables to store the expressions and then use them in the chart expressions if you want to use those pre-defined expressions in multiple charts.
You can also load such expressions from an excel file. Find attached an example excel files with many expressions I am using at different charts.
Expressions Test.xls 41.5 K