Dynamic Expressions per Row Using If() no Set Analysis
So this might not even be possible or so obvious that I have blinders on at this point. That being said I would like to load a list of measures from and Excel document, including some meta data about the dimension and an expression. I started with Set Analysis but after reading, realized that the calculation performs once for the chart and not on a row level, So I have implemented If() statements which I thought might be different but the results are similar to what Set Analysis was doing.
I have scaled back a sample application of what it is I was trying to do for reference and got the same behavior.
In the load script I have:
Load * Inline
//Sample Expression Data Island
Load * Inline
Sales Total (Amount),"Sum(If(Month='MM' and Year='YYYY', Sales,0))"
Sales Total (Transactions),"Sum(If(Month='MM' and Year='YYYY', Counter,0))"
In the chart, I have a table with the Name of the Expression as the dimension and a couple of sample expression fields for months, Jan and Feb which are manually wired in at this time.
As you can see I get - values, however if I select a single record from the measure Name list, the calculations perform as expected.
If anyone has any comments or suggestions, I would greatly appreciate it. Keep in mind my example is sample only, the actual project was slated to have many more measures.
Re: Dynamic Expressions per Row Using If() no Set Analysis
I've attached an example to my original post that shows another trick, i.e. passing parameters to the expression in the variable. That way you don't need to add expressions for each month. You can pass the values of the Month field to the expression. See the pivot table below the Year listbox for an example.