MTD不使用MTD功能

时间:2015-09-07 15:21:00

标签: mdx

这是我们当前的MTD计算:

  MEMBER [Time Calculations].[Time Calculations].[Calculate MTD] AS 
    Sum
    (
      MTD([Date].[Date - Calendar Month].CurrentMember)
     ,[Time Calculations].[Time Calculations].[Current Value]
    )

我在使用范围运算符:的MTD计算的某个地方看到过。以下是从时间开始的总和:

  MEMBER [Time Calculations].[Time Calculations].[Calculate MTD] AS 
    Sum
    (
      null: [Date].[Date - Calendar Month].CurrentMember
     ,[Time Calculations].[Time Calculations].[Current Value]
    ) 

任何人都可以记住如何调整以上内容,以便进行MTD计算吗?

1 个答案:

答案 0 :(得分:1)

如果[Date - Calendar Month]与Adventure Works的Calendar层次结构相似,则以下内容可能适合您:

  MEMBER [Time Calculations].[Time Calculations].[Calculate MTD] AS 
    Sum
    (
      [Date].[Date - Calendar Month].CurrentMember.firstsibling
       : 
      [Date].[Date - Calendar Month].CurrentMember
     ,[Time Calculations].[Time Calculations].[Current Value]
    )