But you want 1 expression, that kind of switches based on the current dimension value?
Then you need to create something that will end up in an expression like
=pick( match(Dimension, 'Sales', 'Turnover', 'Amount')
You can create this expression in your script, there is an example in the forum how to do this, just can't find it right now.
Let me see if I understand you correctly - you would like to have a set of dynamic expressions calculated in a chart (or table) and you are trying to use set analysis to get the correct expression of each line based on a the expression number or name as a chart dimension?
This won't work I am afraid, as the set expression is evaluated once for the chart before the dimensions are created and has no concept of the dimension. The way to solve this problem is to construct a Pick(Match()) type of expression. So let's say that you have the field 'fact' as a dimension. Then you would need an expression like:
Pick(Match(fact_ID, '10', '20', '30'),
If you have a few expressions, then this is quite easy to create. If there are many expressions (I had up to 50 in a recent document), then you will need to construct the Pick(Match()) into a variable and then use
to execute the variable.