如何在SSAS中计算全年MDX

如何在SSAS中计算全年MDX,ssas,mdx,Ssas,Mdx,我正在使用内置的时间智能功能,我想计算全年的测量值。 例如,如果日期的当前成员为2015/03/01;我想要一个从2015/01/01到2015/12/31的计算方法 CREATE MEMBER CurrentCube.[DimTime].[FY-FQ-FM DimTime Calculations].[Full Year] AS "NA" ; ( [DimTime].[FY-FQ-FM DimTime Calculations].[Year to Date] , [DimTime].[

我正在使用内置的时间智能功能,我想计算全年的测量值。
例如,如果日期的当前成员为2015/03/01;我想要一个从2015/01/01到2015/12/31的计算方法

CREATE MEMBER CurrentCube.[DimTime].[FY-FQ-FM DimTime Calculations].[Full Year] AS "NA" ; 
( 
  [DimTime].[FY-FQ-FM DimTime Calculations].[Year to Date]
, [DimTime].[Fiscal Year].[Fiscal Year].Members
, [DimTime].[Date].Members
, { [Measures].[Forecasts], [Measures].[Budget] } 
) 
= Aggregate( 
   { [DimTime].[FY-FQ-FM DimTime Calculations].[Current DimTime] } 
     * PeriodsToDate( 
         [DimTime].[FY-FQ-FM].[Fiscal Year]
       , [DimTime].[FY-FQ-FM].CurrentMember
       ) 
   ) ;

感谢@whytheq和@AkshayRane的帮助。 我可以用下面的方法做全年的练习

(
    [DimTime].[FY-FQ-FM DimTime Calculations].[Full Year],
    [DimTime].[Fiscal Year].[Fiscal Year].Members,
    [DimTime].[Date].Members,
    {
      [Measures].[Forecasts],
      [Measures].[Budget]
    }

)


=

  Aggregate(
             { [DimTime].[FY-FQ-FM DimTime Calculations].[Current DimTime] } 
             *

            PeriodsToDate(
                            [DimTime].[FY-FQ-FM].[Fiscal Year],
                           (
                            ANCESTOR(  
                                      [DimTime].[FY-FQ-FM].CURRENTMEMBER,
                                      [DimTime].[FY-FQ-FM].[Fiscal Year] 
                                    )
                           )
                        )
          )

您的日期/时间维度结构是什么样的?维度中是否有多级用户层次结构?是否要将此计算添加到
多维数据集脚本中
,或者只是尝试将其包含在临时mdx脚本中?感谢您的关注。我的日期维度是常规SSAS时间维度,包括会计期间层次结构,就像普通的季度日历层次结构一样。我想全年计算立方体计算的一部分;例如,如下所示:@whytheqCreate Member CurrentCube.[DimTime].[FY-FQ-FM DimTime Calculations].[Full Year]为“NA”;([DimTime].[FY-FQ-FM DimTime计算].[Year to Date],[DimTime].[Fiscal Year].[Fiscal Year].[Fiscal Year].[Date]。成员,{[Measures].[Forecast],[Measures].[Budget]})=聚合({[DimTime].[FY-FQ-FM DimTime计算].[Current DimTime]}*期间截止日期([DimTime].[FY-FQ-FM].[财年][DimTime].[FY-FQ-FM].CurrentMember))@初学者,上述计算既不是以
多维数据集计算的正确语法进行的,也不是以
特殊MDX查询的正确语法进行的,您能回顾一下并用正确的语法进行吗?另外,请解释您希望通过使用度量值
预测
预算
得到什么样的最终结果。您是否期望从当年第一天到当前日期的合计值?