You are on page 1of 8

5/30/2014

Aggregate Awareness in BO (@Aggregate_Aware in BO Designer) | DWBI castle

Aggregate Awareness in BO (@Aggregate_Aware in


BO Designer)
Madhes Dwbi / January 22, 2014

Aggregate Aware is one of the powerful functions in BO and very common / famous function in Business Objects
Designer and reports. It will speeds up the execution of queries, improving the performance of SQL transactions using
database Aggregate Tables.
Note: When you have Daily & Monthly tables with same set of columns, you can use @aggregate_aware function
and create a single object for both and it will reduce your universe support and maintenance cost. Its not necessary
to have only aggregate tables. It will be used for either Measure or dimension objects.

@Aggregate_aware(sum(MonthlyTable.measure),sum(DailyTable.measure))

@Aggregate_aware(MonthlyTable.dimesion,DailyTable.Dimension)

How aggregate Awareness helping to improve your report performance and process to follow for getting the benefits in
your reports.
Universe Structure without Aggregate tables:
Example, we have 5 Dimension tables and one fact table which holds complete data transactional data in data
warehouse. Based on the dimension in your report to get the data is really huge load to that fact table and the report
wont finish as you expected. Fact table hold the data for Daily transaction for each, customer, Product and branch
and this can be expressed as follows.
365 Days X 5 Products X 2 Country X 100 Customer = 365000 Rows
Below is the Sample Data set for the Fact table.

When you create reports for Daily / Monthly / Quarterly / yearly from this fact table along with some dimension, your
http://dwbicastle.com/2014/01/22/aggregate-awareness-in-bo-aggreagte_aware-in-bo-designer/

1/8

5/30/2014

Aggregate Awareness in BO (@Aggregate_Aware in BO Designer) | DWBI castle

report will read complete table data sets and database engine must add up a large number of rows.
Below is the universe structure for Fact and Dimension model of your current data model.

To avoid the complexity of complete table scan/read/execution, we can create summarized tables for Monthly,
Quarterly and Yearly in your database from the Fact table. Summarized tables will have calculated data for that
particular time periods and your report will read only that particular table to get the data.
Universe Structure with Aggregate tables:
Summary (Aggregated Tables) tables created in Database level and those are physically stored the data in pre
calculated manner. Keeping these aggregated tables in BO universe designer you can created an aggregated aware
objects using @Aggregate_aware function. Aggregate Awareness function will decide which table to choose on the
fly based on your time Period (daily, Monthly, Quarterly & Yearly) selection to query the data from either one of your
aggregated tables.
Below is the universe structure with aggregated tables.

http://dwbicastle.com/2014/01/22/aggregate-awareness-in-bo-aggreagte_aware-in-bo-designer/

2/8

5/30/2014

Aggregate Awareness in BO (@Aggregate_Aware in BO Designer) | DWBI castle

Each aggregated tables will have join with other dimensions tables and along with Time Dim data Sets (see below) by
Month, Quarter and Year.

Below is the detailed schema how the aggregated tables are joined with Time Dimension.

http://dwbicastle.com/2014/01/22/aggregate-awareness-in-bo-aggreagte_aware-in-bo-designer/

3/8

5/30/2014

Aggregate Awareness in BO (@Aggregate_Aware in BO Designer) | DWBI castle

Once you created joins between the aggregated tables with other dimensions tables, you have to create the
Aggregate Objects and need to define the compatible & incompatible objects for those aggregated tables.
Create Aggregate Objects
Before creating the aggregate objects, level of aggregation should be identified and as follows:
YearSalesFact.Revenue is the highest level of aggregation.
QuarterSalesFact.Revenue is the next level.
MonthSalesFact.Revenue is the next level.
SalesFact.Revenue is the lowest level of aggregation.
Define the @Aggregate_aware function object as mentioned below.
@Aggregate_Aware(sum(agg_table_1), sum(agg_table_n)) > agg_table_1 is the aggregate with the highest
level of aggregation, and agg_table_n the aggregate with the lowest level.
Object Name: Sales Revenue
Select : @Aggregate_Aware(sum(YearSalesFact.Revenue), sum(QuarterSalesFact.Revenue),
Sum(MonthSalesFact.Revenue), sum(SalesFact.Revenue ))

http://dwbicastle.com/2014/01/22/aggregate-awareness-in-bo-aggreagte_aware-in-bo-designer/

4/8

5/30/2014

Aggregate Awareness in BO (@Aggregate_Aware in BO Designer) | DWBI castle

Define Compatible and In-Compatible Objects:


Compatible / Incompatible objects must be specified for each aggregate table in the universe. The set of
Compatible / Incompatible objects specify determines which aggregate tables are disregarded during the generation
of SQL in the report.
Compatible / Incompatible definition can be done in Universe Designer, Tools Aggregate Navigation option.

An object is either compatible or incompatible with respect to the Aggregate table. The rules for compatibility as
follows:
When an object is at the same or higher level of aggregation as the table, it is compatible with the table.
http://dwbicastle.com/2014/01/22/aggregate-awareness-in-bo-aggreagte_aware-in-bo-designer/

5/8

5/30/2014

Aggregate Awareness in BO (@Aggregate_Aware in BO Designer) | DWBI castle

When an object is at a lower level of aggregation than the table (or if it is not at all related to the table), it is
incompatible with the table.
As per above example, below is the details of in-compatible objects.
Year Object is in-compatible for Day, Week, Month & Quarter (Since Year is having highest level of aggregated data)

Quarter Object is in-compatible for Day, Week and Month.

Month Object is in-compatible for Day, Week.

http://dwbicastle.com/2014/01/22/aggregate-awareness-in-bo-aggreagte_aware-in-bo-designer/

6/8

5/30/2014

Aggregate Awareness in BO (@Aggregate_Aware in BO Designer) | DWBI castle

Day is in-compatible for aggregated objects.

Report Query SQL generation:


When you create a report based on Yearly Sales, add Year and Sales Revenue object in the Query panel and BO
would decide to the take the data from YearSalesFact which is @aggregate_aware functions capability.

http://dwbicastle.com/2014/01/22/aggregate-awareness-in-bo-aggreagte_aware-in-bo-designer/

7/8

5/30/2014

Aggregate Awareness in BO (@Aggregate_Aware in BO Designer) | DWBI castle

SQL query will looks as below.

SQL generation will change based on the Time Period object you select in the Query. You can see huge
performance changes when use Aggregate Aware function in your report.

http://dwbicastle.com/2014/01/22/aggregate-awareness-in-bo-aggreagte_aware-in-bo-designer/

8/8

You might also like