【问题标题】:MDX - Running total (MAT) with attribute hierarchy or any combinationMDX - 具有属性层次结构或任意组合的运行总计 (MAT)
【发布时间】:2018-01-31 17:45:59
【问题描述】:

我正在尝试获得具有单个属性和年月的 MAT 等级制度。行上的年份和月份很好(请参见附图左侧),但是当年份位于列上时我无法找到解决方案(请参见附图右侧)。我尝试了年月层次结构和属性层次结构和后代的不同组合, 过滤器等功能,但它们都不起作用。

提前致谢。

【问题讨论】:

    标签: ssas mdx


    【解决方案1】:

    它可能会帮助某人发布我找到的解决方案。

    它使用现有的 Year > Month > Date hiearchy with a 'Month Of Year' 属性层次结构。

    这里的关键是 StrToMember,它返回用于年 > 月 > 日期(层次结构)的成员

    with
    MEMBER YearName AS 
    RIGHT([TIME].[Year].CurrentMember.Name,4)
    
    MEMBER MonthName AS 
    [TIME].[Month Of Year].CurrentMember.Name
    
    MEMBER [Measures].[Sales Value-MAT] AS
        sum(  
            LastPeriods(
            12,
            StrToMember("[TIME].[Hierarchy].[" + MonthName  + " " + YearName +  "]")
           ), [Measures].[Sales Value])
    
    select  
             {[TIME].[Year].[Year].members * [Measures].[Sales Value-MAT]} on columns,
    NON EMPTY { [TIME].[Month Of Year].members  } ON rows 
    
    from  [SalesCube]
    

    灵感来自 this 线程中的最后一篇帖子。

    【讨论】:

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