2014-03-30 162 views
0

我希望能夠創建一個計算成員,即每月每日平均值的平均值。我已經嘗試了本使用的AdventureWorks立方體以下MDX:每月每日平均冒險工作坊的平均數

with Member Measures.DailyAverage AS 

Avg (EXISTING 
    {[Date].[Date].[Date].Members}, 
    [Measures].[Internet Order Count] 
    ) 


Member MonthlyAverageOfDailyAverage AS 
Avg (EXISTING 
    {[Date].[Month of Year].Members}, 
    Measures.DailyAverage 
    ) 

select {(DailyAverage),(MonthlyAverageOfDailyAverage)} on columns, 
[Date].[Calendar Year].Members on rows 
from [Adventure Works] 

這不會產生我期待的答案,只是看2005年7月至今146個網上訂單31天的訂單,因此一日平均4.709,8月日平均爲5.2,9月= 5.379,10月= 5.2,11月= 5.2,12月= 5.032。我想要這些日均值應該是5.120的平均值。上面的MDX給我5.588。我的計算成員應該怎樣才能得到我想要的? 感謝

回答

0

你mannual計算證實了七月和八月僅

with Member Measures.DailyAverage AS 

Avg (EXISTING 
    {[Date].[Date].[Date].Members}, 
    [Measures].[Internet Order Count] 
    ), format_String="##.000000" 

select (DailyAverage) on 0, 
[Date].[Calendar Year].&[2005] * [Date].[Calendar].[Month] on 1 
from [Adventure Works] 

enter image description here

菲利普,