To use IBM Cognos product documentation, you must enable JavaScript in your browser.

Aggregate Functions

Executes a predefined function and returns an aggregate for a set of values based on the function values.

Note: You can access aggregate functions through calculated categories, calculated measures and dimension calculations. You cannot access them through calculated columns.

Aggregate

Description

Absolute

Converts numbers to their unsigned value.

Average

Returns the average value.

Change

Returns the difference over a linear series of categories by calculating the change between each pair of categories.

Max

Returns the maximum value of selected data items.

Min

Returns the minimum value of selected data items.

Percent

Returns the percent of the total value for selected data items.

Percent-growth

Returns the growth over a linear series of categories by calculating the percentage change between each pair of categories.

Share

Returns the values of categories as a percent share of other target categories.

Absolute

Converts numbers to their unsigned value.

Use when you need positive numbers, or when you need to find the absolute difference between values in a list of positive and negative values.

Syntax

absolute (numeric_exp)

Examples

absolute (-5.3)

Returns the result: 5.3

absolute (2)

Returns the result: 2

Average

Returns the average value of selected data items.

Transformer supports the Average function with numeric data; the only parameters accepted are the numeric expressions and the auto component.

Syntax

average (<numeric_exp)

Example

average (Sales)

Returns the result: The average of all Sales values.

Change

Returns the difference over a linear series of categories by calculating the change between each pair of categories. The order of pairs is based on the object ID of each category.

Note: This function is used for automatically generated relative time categories, such as year-to-date (YTD Change). It appears in the list of Available Components when you use the expression editor to create a calculated category.

Tip: To use ToolTip on the pop-up diagram to show the labels and object IDs of categories, select the Object Identifier check box in the Preferences properly sheet, (Titles tab).

Syntax

change (cat_code, cat_code|set|level)

Example

A dimension contains a level with Quarters Q1 to Q4. To create change categories for Q1-Q2, Q2-Q3, and Q3-Q4, use the function

change ("Quarter")

Max

Returns the maximum value of selected data items.

Syntax

max (numeric_exp)

Example

max (Sales)

Returns the maximum value of all Sales values.

Min

Returns the minimum value of selected data items.

Syntax

min (numeric_exp)

Example

min (Sales)

Returns the minimum value of all Sales values.

Percent

Returns the percent of the total value for the selected data items.

Users can format the percentage data so that it reads as a ratio (for example: .25 vs. 25%).

Syntax

percent (numeric_exp)

Example

percent (sales 07)

Returns the percentage of the total sales for 2007 that is attributed to each sales representative.

Sales Rep

Sales 07

Percentage

Bill Gibbons

60646

7.11%

Bjorn Flertjan

62523

7.35%

Chris Cornel

22396

2.63%

Conrad Bergsteige

13500

1.59%

Percent-growth

Returns the growth over a linear series of categories by calculating the percentage change between each pair of categories. The order of pairs is based on the object ID of each category.

Note: This function appears in the list of Available Components when you use the expression editor to create a calculated category.

Tip: To use ToolTip on the pop-up diagram to show the labels and object IDs of categories, select the Object Identifier check box in the Preferences properly sheet (Titles tab).

Syntax

percent-growth (cat_code, cat_code|set|level)

Example

A dimension contains a level with Quarters Q1 to Q4. To create growth categories for Q1-Q2, Q2-Q3, and Q3-Q4, use the function

percent-growth (Quarter)

Share

Returns the values of categories as a percent share of other target categories.

Syntax

share (cat_code,cat_code|set|cat_code, set|set|level)

Example

A dimension contains the category Color with several descendant categories, such as Black and Chrome, which you define as a set. To create two share categories, representing each of Black and Chrome, as a percentage of share of the parent, use the function

share (set, Color)