【问题标题】:Total is missing while create calculated measure using parallelperiod使用并行周期创建计算度量时缺少总计
【发布时间】:2018-03-11 03:56:51
【问题描述】:

以下是我的查询。

    WITH  
       MEMBER [Measures].[Quantity - Prior Year] As  
         ( 
           PARALLELPERIOD(
             [Date].[Fiscal Year].[Fiscal Year]
           , 2
           , [Date].[Fiscal Year].CurrentMember
           )
         ,[Measures].[Order Quantity]
         )  
     SELECT 
       {
        [Measures].[Order Quantity], 
        [Measures].[Quantity - Prior Year]
       } ON AXIS(0)
     , {DrilldownLevel([Date].[Fiscal])} ON AXIS(1)
     FROM [Adventure Works]  
       CELL PROPERTIES VALUE, FORMAT_STRING, FORMATTED_VALUE

但计算度量的总计始终为 NULL?

任何帮助将不胜感激。

【问题讨论】:

  • 您是否在问为什么“所有期间”、“2002 财年”或“2003 财年”的“数量 - 上一年”为 NULL?
  • @jhenninger24 不,我想他在问为什么“数量 - 上一年”和“所有期间”的单个单元格为空?而不是总和 [null + null + 24096 + 82181] ?

标签: sql null mdx


【解决方案1】:

看起来“所有期间”是系统为[Date].[Fiscal Year] 层次结构生成的All 成员。

从此Microsoft doc 中,它是[Date].[Fiscal Year] 层次结构中所有成员的预聚合度量值的成员。当将此成员传递给 ParallelPeriod() 函数时,将聚合值滞后 2 个会计年度是没有意义的,因此它返回 null。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-15
    • 2023-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多