...and I want to be able to choose different Months in the states e.g. Jan-Mar in State 1 and Apr-Jun in State 2, it will always be the same number of month like in the example 3 month from state 1 and 3 month from state 2.
The aggregation expression will after this not be the same (i know that) e.g. "AggregationKey, Jan" and "AggregationKey, Apr".
Can this be solved? I've tried to rank the months so each state will have 1, 2, 3 as ranked month but i can't get it ti work.
Basically make the Aggrkeys to be the same despite the fact they are'nt...!!!
If each avg(...) function alone does return the correct price results (i.e. reflect the month selection in its state), just take care that your outer sum() is calculated in the context of the full set of all records 1 , like