2017-09-15 62 views
1

使用TopPerent功能,您可以獲得符合所提供的%值的成員集合 - 自頂向下排序。計算icCube |中層次結構成員的累計百分比TopPercent,但不同於

我想切換這個函數,並獲得給定成員的累計%。圖像的

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

說明: TopPercent在icCube,在Excel中所有的國家定購自上而下的金額。 Cum%caluclated。藍色顯示的值表示的值,我想獲得

+0

你需要射精%MDX版本,對不對? –

+0

是的,但我也找到了答案。我不知道它是最好的,但它有效。 – Arthur

+0

更正 - >我找到了我原來的問題的答案,我沒有發佈在這裏。我無法回答這個具體問題,我只是找到了另一種計算我需要的方法。我仍然對如何計算這個問題感到好奇。 – Arthur

回答

2

我希望這將足以明白點:

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] 
+0

完美。這是我正在尋找的。非常感謝。 – Arthur

+0

(高調)非常好的答案 – whytheq