Report Portal

MDX-How do you get Last month in the time dimension

Q: How do you get Last month in the time dimension

A: You can use function ClosingPeriod( [ Level_Expression [ ,Member_Expression ] ] )

Example (here we assume that default member is [All]):

SELECT ClosingPeriod([Date].[Calendar].[Month], [Date].[Calendar].DefaultMember) ON 0
FROM [Sales Summary]
WHERE ([Measures].[Sales Amount])

Result:

August 2004
(null)

Tags: mdx, faq, time dimension

 

2007-2015 VidasSoft Systems Inc.