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. It’s not necessary to have only aggregate tables. It will be used for either Measure or dimension objects.
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 won’t 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 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.
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 ))
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.
- 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.
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.
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.