SSAS FAQ MDX FAQ MDX-Query to get the first month of the last year loaded into a cube
MDX-Query to get the first month of the last year loaded into a cube
User Rating: / 0
PoorBest 
Written by Vidas Matelis   
Thursday, 29 March 2007 18:28

Q: I Need an MDX statement to get the first month of the last year loaded into a cube

A: First you can use ClosingPeriod at Year level to get the last year, then use the OpeningPeriod function for the Month level to get the first month. Example:

SELECT OpeningPeriod([Date].[Calendar].[Month]
, ClosingPeriod([Date].[Calendar].[Calendar Year], [Date].[Calendar].DefaultMember)
) ON 0
FROM [Sales Summary];

Results:

January 2004
$3,002,792.27

 
Strategy Companion