对于MDX中的给定度量,我如何计算每周和2周前的差异?
WEEK MEASURE NEW_MEASURE
---- ------- -----------
1 10 NULL
2 5 NULL
3 20 10
4 10 5
5 40 20
在会员工作之下,但只有没有CASE声明,所以我必须单独计算:
MEMBER [Measures].[12 Week temp]
AS
([Date].[Week Year].CurrentMember, [Measures].[Total Orders]) -
([Date].[Week Year].lag(13), [Measures].[Total Orders])
MEMBER [Measures].[12 Week]
AS
CASE WHEN [Measures].[12 Week temp] = [Measures].[Total Orders] THEN 0 ELSE [Measures].[12 Week temp] END