Report Portal

MDX-Query to get the first month of the last year loaded into a cube

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

Tags: mdx, faq

 

2007-2015 VidasSoft Systems Inc.