Summarize data in your reports to obtain totals, averages, aggregates, and so on.
You can specify summary aggregation in different ways by using any of the following:
How data is summarized also depends on the type of data that you are summarizing. Summary rules are applied differently to facts, identifiers, and attributes. For example, if you summarize a data item that represents part numbers, the only summary rules that apply are count, count distinct, count non-zero, maximum, and minimum. For information about how to determine the type of data that a data item represents, see Add Relational Data to a Report and Add Dimensional Data to a Report.
This problem occurs in, but is not limited to, the following:
context filters that select more than one member of a hierarchy that is used elsewhere on the report
The aggregate button sets the rollup aggregate property for
the data item to the selected summary aggregate, and places the
data item into an appropriate footer. A footer is created for each
set, hierarchy, or level.
For information about adding a rolling or moving average, see Rolling and Moving Averages.
To change the summary label, do the following:
Click the label.
In the Properties pane, under Text Source, set the Source Type property to the source type to define the label.
For example, set it as Data Item Value to produce a dynamic label for the summary based on data item values.
Set the property below Source Type to specify the label.
This property depends on the source type you chose. For example, if you chose Data Item Value as the source type, set the Data Item Value property to the data item to use to define the label.
In crosstabs and charts, the summary appears as a node .
To change a summary, select it and,
in the Properties pane, under Data
Item, click Rollup Aggregate Function and
choose a different function.
In crosstabs, you can add multiple summaries at the same level. For example, you have a crosstab with Product line as rows, Order year as columns, and Revenue as the measure. For Product line, you can add the Total summary as a header, which will total all revenue for each order year. You can then add the Average summary as a footer, which will give the average revenue of all product lines for each order year.
If you are working with a dimensional or a dimensionally-modeled
relational (DMR) data source, you must specify the aggregation mode .
The aggregation mode sets the aggregation clause to be used in the
data item expression.
In crosstabs, aggregated values are calculated using one of the following aggregate expressions:
aggregate ([measure within detail [data item]) aggregates the lowest level of details in the report.
aggregate ([measure within aggregate [data item]) aggregates each level of details in the report.
You decide which aggregate expression is used
by setting the aggregation mode .
For example, in the following crosstab, if you specified Total as the summary, these aggregate expressions are produced for each aggregation mode:
Total ([Revenue] within set [Quarter])
This expression totals the quarter values from the data source at the intersecting product line. At the bottom right corner, it totals the aggregate over all product lines for each quarter.
Total ([Revenue] within detail [Quarter])
This expression totals the month values visible in the report at the intersecting product line. At the bottom right corner, it totals all of the intersecting month - product line values visible in the report.
Total ([Revenue] within aggregate [Quarter])
This expression totals the month values visible in the report at the intersecting product line into quarters. At the bottom right corner, it does the same, but starting with the aggregate over all product lines for each month.
In simple cases, the members and values visible in the report and the aggregate rules in the report are the same as those in the data source and all of these expressions produce the same results.
For example, for the quarter and month values, if you are totaling the values for all months in all quarters, it makes no difference whether the visible values, the values in the cube, or the month and quarter values are used. The result is the same.
Tip: The Total Revenue by Country sample report in
the GO Data Warehouse (query) package includes a total summary
function. For more information about The Great Outdoors Company
samples, see Sample Reports and Packages.
Different results appear when you start filtering, changing aggregation types, or using set expressions or unions.
For example, the following crosstab shows the quantity of products sold across all product types for each product line. The bottom of the crosstab has three summary values that show the average quantity of products sold by product line.
Each summary value uses a different aggregation mode that is indicated in the summary name.
Average(Product line) - within detail
This summary is the average of the detail values in the crosstab.
Average(Product line) - within aggregate
For each product line, the average of the detail values is calculated. This is equivalent to applying the average aggregation function to the Product type column. This summary is the average of the product type averages.
Average(Product line) - within set
This summary is the average of the product type values rolled up into sets at the Product line level. The values are obtained from the data source. If filters or slicers exist, the values are recomputed using the aggregation rules defined in the data source.
In most cases, you should use the within detail aggregation mode because the results are easiest to understand and the same as the results for footers in a grouped list report. In more complex cases, you may consider the within aggregate aggregation mode. The within set aggregation mode should be reserved for reports with a purely dimensional focus such as when there are no detail or summary filters defined in the report.
For example, the product line rows below were defined using the expression
union([Product line], [Camping Equipment], ALL)
where [Product line] is the level that contains Camping Equipment.
For IBM Cognos PowerCubes, Aggregate(Product line) is the sum of the product lines excluding duplicates. For more information about how the aggregate function is processed, see Summary Functions.
The aggregation function must apply to all members of a level or all children of a member.
Error cells are produced when drilling down on a crosstab that has two nested levels.
If you do not consider these limitations in a calculation, the report may return inaccurate results.
This section describes the summary functions that are
available in Report Studio. Some functions, such as Custom, are
available only when you click the aggregate button on
the toolbar. Additional summary functions are available in the Expression
Editor
.
In lists, sets the summary function to Automatic.
In crosstabs, sets the Rollup Aggregate Function to Automatic.
The Aggregate function uses the summary rules
for Automatic.
In all other contexts, None is applied.
Adds all existing values and then divides by the count of existing values.
In crosstabs, this function overrides any solve orders that
are specified .
Object | Behavior |
Level | Count distinct is used. A warning appears when you validate the report. |
Member set | Count distinct is used. A warning appears when you validate the report. |
Attribute | Not supported. An error is returned when you run the report. |
Measure | Supported. |
Object | Behavior |
Level | Count distinct is used. A warning appears when you validate the report. |
Member set | Count distinct is used. A warning appears when you validate the report. |
Attribute | Supported. |
Measure | Supported. |
Returns the total number of unique non-null records.
Object | Behavior |
Level | Supported. |
Member set | Supported. |
Attribute | Not supported. An error is returned when you run the report. |
Measure | Not supported. An error is returned when you run the report. |
Summarizes data based on an expression that you define.
Selects the largest existing value.
Returns the median value of the selected data item.
Selects the smallest existing value.
If the underlying data source is relational, the data item is
grouped when the query property Auto Group & Summarize is set to Yes.
This setting should not be applied to a simple model reference.
This setting is relevant only for reports that are upgraded from IBM Cognos ReportNet® 1.x.
Returns the standard deviation of the selected data item.
From a mathematical perspective, this function is not useful
for small numbers of items and is not supported if the query property Auto
Group & Summarize is set to Yes.
Returns the variance of the selected data item.
Data source | Framework Manager | Report Studio |
None specified, or none | Unsupported | None |
average (avg) | Average | Average |
count | Count | Count |
count distinct | Count Distinct | Count distinct |
maximum (max) | Maximum | Maximum |
minimum (min) | Minimum | Minimum |
median | Median | Median |
standard deviation (stddev) | Standard Deviation | Standard Deviation |
sum | Sum | Total |
variance (var) | Variance | Variance |
count non zero | Count Non-Zero | Automatic |
average non zero | unknown | Automatic |
external | unknown | Automatic |
any | unknown | Automatic |
calculated | unknown | Automatic |
unknown | unknown | Automatic |
first_period | unknown | Automatic |
last_period | unknown | Automatic |
Framework Manager | Report Studio |
Automatic | Automatic |
Calculated | Calculated |
No corresponding summary function | Summarize |
No corresponding summary function | Not Applicable |