【问题标题】:calculate the cumulative % of a hierarchy member in icCube | TopPercent but than different计算 icCube 中层次结构成员的累积百分比 | TopPercent 但不同
【发布时间】:2017-09-15 09:02:19
【问题描述】:

使用函数 TopPerent,您可以获得符合提供的 % 值的成员集 - 自上而下排序。

我想切换此功能并获取给定成员的累积百分比。

图片说明: icCube 中的 TopPercent,Excel 中的所有国家/地区按金额从上到下排序。累计计算百分比。蓝色突出显示的值表示我想要获得的值

【问题讨论】:

  • 你需要 Cum % MDX 版本,对吗?
  • 是的,但我也找到了答案。我不知道它是最好的,但它确实有效。
  • 更正 --> 我找到了未在此处发布的原始问题的答案。我无法回答这个具体问题,我只是找到了另一种计算我需要的方法。我仍然对如何计算这个感到好奇。
  • (upped) 非常好的问题

标签: mdx iccube


【解决方案1】:

我希望这足以理解这一点:

With 
Set [OrderedCity] as
Order([Customer].[City].[City].Members,[Measures].[Internet Sales Amount],DESC)    

Member [Measures].[Cum] as
Sum(    
    Head([OrderedCity],Rank([Customer].[City].CurrentMember,[OrderedCity])),
    [Measures].[Internet Sales Amount]
)

Member [Measures].[Cum %] as
[Measures].[Cum] / ([Customer].[City].[All],[Measures].[Internet Sales Amount]),
Format_String = "Percent"

Select
Non Empty [OrderedCity] on 1,
{[Measures].[Internet Sales Amount],[Measures].[Cum],[Measures].[Cum %]} on 0
From [Adventure Works]

【讨论】:

  • 完美。这就是我一直在寻找的。非常感谢。
  • (upped) 非常好的答案
猜你喜欢
  • 2017-03-03
  • 2019-01-09
  • 1970-01-01
  • 1970-01-01
  • 2021-10-15
  • 2018-09-08
  • 1970-01-01
  • 2021-08-21
  • 1970-01-01
相关资源
最近更新 更多