based on a YearMonth dim I need to present actual and previous period data. Period can be from one to many YearMonths and must be shown as previous period start = min(actual)-1-(max(actual)-min(actual)) and previous period end = min(actual)-1 e.g.
actual: 201303 - 201304, previous: 201301 - 201302
actual: 201205 - 201208, previous: 201201 - 201204
and that seems be easy when periods are within one year. Problem comes when we cross two years e.g.
actual: 201302 - 201304, previous: 201211 - 201301
How can I refer to the prevoius period not to get period like 201299 or 201300.