计算累积值MDX

时间:2018-10-31 19:52:17

标签: mdx cumulative-sum

我正在尝试为测量“已关闭的WIT历史记录”计算累计值 一个月的水平,但没有运气

这是我的时间维度:

Dimensions

这是我的查询:

WITH MEMBER [MEASURES].[Sales To Date]

AS

Sum

(



PeriodsToDate([DWH Dim Date].[(All)]),[Measures].[Closed WIT History]



)

SELECT

   {[Measures].[Closed WIT History], [MEASURES].[Sales To Date]} ON COLUMNS,

   [DWH Dim Date].[Month Name].[Month Name].Members ON ROWS

FROM [CUBE_Rel_1_AED_SAFe]

where [DWH Dim Date].[Year].&[2018]

但是,由于某种原因,我得到了以下结果:

results

我在做什么错?我也尝试过以下查询:

WITH

 MEMBER [MEASURES].[Sales To Date] as

 SUM(

      {[DWH Dim Date].CurrentMember.Level.Members}.Item(0):[DWH Dim Date].CurrentMember,[Measures].[Closed WIT History]

         )





SELECT

   {[Measures].[Closed WIT History],[Measures].[Sales To Date]} ON COLUMNS,

   [DWH Dim Date].[Month Name].[Month Name].Members ON ROWS

FROM [CUBE_Rel_1_AED_SAFe]

where [DWH Dim Date].[Year].&[2018]

但是然后我得到这样的错误:

error in the calculated column

1 个答案:

答案 0 :(得分:1)

您可以单击#Error以查看详细信息。此外,您还可以使用以下表达式来实现您的目标

有成员[措施]。[S2] AS   和(       {[日期]。[月名称]。&[2005]&[一月]:[日期]。[月名称] .CurrentMember}     ,[度量]。[互联网销售数量])

在行上选择非空([日期]。[月名称]。[月名称] .members),在行上非空({[Measures]。[S2],[Measures .. [Internet Sales Count]}})。 [Analysis Services教程]

enter image description here

佐伊