Schema design: creating measures
Measure objects provide calculated numeric information (aggregated numbers) by which dimensions are dynamically compared. Measures are flexible as the values they store depend on the dimension objects used with them. Measure object are calculate with one of the aggregate functions.
- SAP Business Objects provides the following most commonly used basic types of aggregation:
- Sum
- Count
- Average
- Maximum
- Minimum
The full set of aggregate functions is listed in the Number Functions selection list of the Edit Select Statement window.
From the technical point of view and speaking the SQL language, whenever a query contains measures with dimensions, a SELECT with GROUP BY statement is created. Whenever the SELECT statement contains an aggregate, every dimension column of that aggregate must appear in the GROUP BY clause and measures must include an aggregate functions (sum, avg, etc.).
There are two levels of aggregation in the SAP BusinessObjects query process: at SELECT level and at projection level.
Aggregation at SELECT level starts when a query is created by an user, a reporting tool creates the SQL and sends a SELECT statement to the database. Then the data is returned to a microcube where the first level of aggregation occurs, the microcube projects the aggregated data onto a report, the SQL is run and the microcube gets the results.
Aggregation at projection level means that when a query is run and the resultset is loaded into the microcube, all from that microcube is projected into a table or chart in the report (a block). Therefore, no projection aggregation takes place.