同比、环比、年累计等等MDX计算方式网上一大堆,但是还缺少一些,以下是整理出的一种使用微软MDX计算 去年年累计的计算方法。或许可以提供给大家参考一下。
WITH MEMBER [Measures].[LastYearYTDSalesAmount] AS
Aggregate(
YTD(ParallelPeriod([DimTime].[Y-M-D].[YEAR], 1, [DimTime].[Y-M-D].CurrentMember))
, [Measures].[SalesAmount])
MEMBER [Measures].[DT] AS
[DimTime].[Y-M-D].CurrentMember.UniqueName
SELECT { [Measures].[DT]
, [Measures].[LastYearYTDSalesAmount]
, [Measures].[Amount]} ON COLUMNS
, {[DimTime].[Y-M-D].[Date].Members} ON ROWS
FROM [Sales]
转载请注明来自 pgy8288,谢谢。希望对大家有所帮助。