微软BI开拓者

首页 » 多维分析专区 » MDX » How is the Aggregation of records with the same...?
Administrator - 5/29/2007 5:00:00 PM
How is the Aggregation of records with the same combination of granularity attributes when processing data?

How is the Aggregation of records with the same combination of granularity attributes when processing data?

--谭东原创,转贴请注明出自微软BI开拓者www.windbi.com


If there are multiple records with the same combination of granularity attributes when processing data ,
how these records are aggregated for the specific coordinate in the physical space?




e.g.


[date]
(it is the dimension talbe , which has only one column called date):


date


2007-1-1 0:00:00


2007-1-2 0:00:00


2007-1-3 0:00:00


2007-1-4 0:00:00


2007-1-5 0:00:00





[sales]


(it is the fact table , which has tow columns:time , amount.)


time


amout


2007-1-1 1:00:00


1


2007-1-1 2:00:00


2


2007-1-1 3:00:00


3


2007-1-2 0:00:00


8




In the DSV,I add a named calculation called [date] , whose definition is as follow, to the table [sales].
[date]: dateadd(day , 0 , datediff(day , 0 , time))

Than I establish a relationship between these two table:
[sales].[date]
à[date].[date]

So there are three records corresponding to [2007-1-1 00:00:00]:

Amount


Date


1


2007-01-01


2


2007-01-01


3


2007-01-01




What is the value for [2007-1-1 00:00:00] when the AggregateFunction of [amount] is sum , count , max , min , lastchild etc. respectively?
Try this!
For myself , the value for [2007-1-1 00:00:00] is 6 when the AggregateFunction is LastChild.
And,
the value for [2007-1-1 00:00:00] is 6 when the AggregateFunction is None;
the value for [2007-1-1 00:00:00] is 6 when the AggregateFunction is AverageOfChildren;
the value for [2007-1-1 00:00:00] is 3 when the AggregateFunction is Max;
the value for [2007-1-1 00:00:00] is 1 when the AggregateFunction is Min;
the value for [2007-1-1 00:00:00] is 6 when the AggregateFunction is FirstChild;
the value for [2007-1-1 00:00:00] is 6 when the AggregateFunction is LastNonEmpty;
the value for [2007-1-1 00:00:00] is 6 when the AggregateFunction is Sum.


Please pay your big attention to "AverageOfChildren","Max" ,and "Min".
1
查看完整版本: How is the Aggregation of records with the same...?