InfoCube Aggregate聚集介绍
<摘自网络>
BW中聚集是指根据InfoCube中几个或者一个维度信息对象创建的小的CUBE,其实是新生成一张事实表,外加一些对应的维度表,可以提供数据的访问效率。
An aggregate is a roll up of fact data where a total value is sufficient and no detailed information is needed.
Technically speaking,an aggregate is a separate infoCube with its own fact table and dimension tables.When an aggregate is created,it is gaven six-digit number <1NNNNN> that starts with a ì1?. The table name for an aggregate is derive in the same way from this number as InfoCube table names are derived from InfoCube names.
For example, if an aggregate has the technical name 100001, its fact tables are
called /BIC/E100001 and /BIC/F100001. Its dimensions have the table names
/BIC/D100001P, /BIC/D100001T, and so on.
Dimension tables can be shared between an InfoCube and an aggregate. In this
example, dimension 2 (the country dimension) is shared between the InfoCube
and the aggregate. It is not necessary to create a new dimension table. A link to
this dimension table is created in the aggregate fact table.
聚集维度可以分为“层次结构的聚集”(H)、“固定值的聚集维度”及“一般聚集维度”;其主要用法根据实际使用来确定,例如某张报表只会访问到某个层次结构的N层次,再往下就不看了,则可以给CUBE生成一个对应的聚集,该聚集维度基于该层的“层级结构维度”。
其中对于聚集中维度数据和事实表数据的更新,如果是导航属性生成的维度表,则通过信息对象的change run可以同步聚集维度表数据,而事实表数据通过ROLL UP可以更新。
简单来说,聚集的作用是:预先计算,以空间换时间。提高Query的查询效率。
下图为InfoCube中的数据,即事实表中的数据,第6列为数量,第7列为合计金额,第8列为单价
Aggregate中的数据
0FACTCOUNT代表聚集的记录数,Y2IO_QUAN为合计的数量(共合计了3条记录),Y2IO_REV为合计的金额数
Sales Price为合计的价格(无用,此记录不应该被合计)