The query runtime might be slightly higher if any, but you will save on the network traffic and the total rendering time within your report, thereby the total runtime will be way less!
It should be mandatory to use a SQL aggregate function (such as SUM, AVG, MAX, MIN, etc.) for measures IMHO. For SAP HANA this is a MUST.
Anyway, one uses SQL aggregate function in measures to force a Group BY in the generated SQL statement so that the DBMS returns already aggregated rows (meaning: fewer database records). SQL aggregation at the database level will in almost all scenarios perform significantly better than projection at the report level.
Consider for example:
SELECT
SUM (MyFactTable.Measure)
FROM
MyFactTable
This will return only one row with the grand total, all the processing will be done on the database server (and not on your local workstation)
Now consider the following example:
SELECT
MyFactTable.Measure
FROM
MyFactTable
This will return as many rows as there are in the fact table (potentially millions of records), if you are interested in the grand total, you will have to deal with the millions of records and sum them up on your local workstation to get the one grand total instead of putting the load on the database server.
Note:
For a measure you can define the aggregation in the SELECT box within Designer and the projection in propeties of a measure in Designer. These are two different settings.
Aggregation defines which aggregation is used in the generated SQL code.
Projection defines how a measure is rolled up after the data has been returned to a report.
Aggregation and projection go hand in hand, as a rule of thumb use the following settings:
AGGREGATION Projection
-------------------------------
SUM sum
MIN min
MAX max
COUNT sum
AVG NONE*
COUNT DISTINCT NONE**
- Averages can only be calculated correctly at the report level using a local report variable to ensure that the average is calculated correctly when drilling in a report! See also 2-Phase calculation in Essbase for example, a feature which still does not exist in Business Objects Designer.
NEW in XI R3.x: There is a new projection available since XI R3.x called database delegated measure, a.k.a. smart measure, which will require a refresh of the query though.
** Count Distinct can only be calculated when all detail information is available at time of counting distinct, aggregation cannot accour without running a Count DISTINCT against the detail level again.
NEW in XI R3.x: There is a new projection available since XI R3.x called database delegated measure, a.k.a. smart measure, which will require a refresh of the query though.
See also here.
Andreas (BOB member since 2002-06-20)