计算icCube中层次结构成员的累积百分比TopPercent但不同

时间:2017-09-15 09:02:20

标签: mdx iccube

使用TopPerent功能,您可以获得符合所提供的%值的成员集(自上而下排列)。

我想切换此功能并获得给定成员的累积%。

TopPercent in icCube, all countries in Excel ordered top down on Amount. Cum % caluclated. The BLUE highlighted values indicate the value I would like to obtain

图像描述: 在icCube中的TopPercent中,Excel中的所有国家/地区都按照金额进行了自上而下的排序。暨%caluclated。蓝色突出显示的值表示我想要获得的值

1 个答案:

答案 0 :(得分:3)

我希望能够理解这一点:

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]