MDX周数之间的差异

时间:2016-09-23 07:14:22

标签: sql-server ssas mdx cube

对于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

0 个答案:

没有答案