1. Calculation functions
2. All functions
3. Aggregation functions
4. AVERAGE

The AVERAGE aggregation function takes a set of values from a source module and returns the mean average in a result module.

For example, you can use the AVERAGE function to determine the average sales revenue generated by employees.

## Syntax

Values to average[AVERAGE: Mapping, AVERAGE: Mapping 2, etc.]

## Arguments

 Argument Data type Description Values to average Number The values to return the average of based on the Mapping argument. Mapping List, date, time period The mapping that determines which values to return the average of. Must be a dimension in both the source and target modules. This argument can be repeated to provide multiple mappings.

The AVERAGE function returns a numeric result. The result line item must share all dimensions used for the Mapping arguments.

## Syntax example

'Employee Details'.Sales Revenue[AVERAGE:'Employee Details'.Seniority, AVERAGE: 'Employee Details'.Region]

In this example, the average sales revenue is returned for each combination of seniority and region.

### Summary method

Average can also be used as a summary method. You can use the summary method on line items with the number data type.

### Use AVERAGE with the Users list

You can reference the Users list with the AVERAGE function. However, you cannot reference specific users within the Users list as this is production data.

## Constraints

The dimensions of the Mapping argument must also be dimensions of the Values to average argument.

AVERAGE

## Examples

These examples each use two modules. One that contains the data to aggregate, and one that uses the AVERAGE function with this data.

The first is the Employee Salaries module. In this module, the Employees list is on rows. Several line items that contain information about each employee are on columns. The Seniority and Region line items have the list data type for the Seniority and Region lists respectively.

### Average salary by region

In this module, the Region list is on columns. On rows, a single line item contains a formula that uses AVERAGE to calculate the average salary in each region.

 Region A Region B Region C Region D Average salary by region Employee Salaries.Salary[AVERAGE: Employee Salaries.Region] 58,333 74,667 47,600 63,000

### Average salary by seniority

In this module, the Seniority list is on columns. On rows, a single line item contains a formula that uses AVERAGE to calculate the average salary for each seniority.

 Grade 1 Grade 2 Grade 3 Grade 4 Average salary by seniority Employee Salaries.Salary[AVERAGE: Employee Salaries.Seniority] 39,200 45,000 65,500 100,000

### Average salary by region and grade

In this example, the Region list is on columns, and the Seniority list is on rows. Line items are on pages, and the selected line item contains this formula:

Employee Salaries.Salary[AVERAGE: Employee Salaries.Region, AVERAGE:Employee Salaries.Seniority]

The formula calculates the average salary for employees for each combination of region and seniority.

 Region A Region B Region C Region D Grade 1 0 22,000 24,000 63,000 Grade 2 43,333 0 50,000 0 Grade 3 60,000 62,000 70,000 0 Grade 4 80,000 140,000 0 0

## Use average to count unique values

This example uses a formula with the AVERAGE function with the Count Value line item in the Employee Salaries module to determine if there's an employee for each combination of region and seniority. If so, the formula returns a value of 1. If SUM were used, it would count the total number of employees for each combination of region and seniority. The formula used is:

Employee Salaries.Count Value[AVERAGE: Employee Salaries.Region, AVERAGE:Employee Salaries.Seniority]

 Region A Region B Region C Region D Grade 1 0 1 1 1 Grade 2 1 0 1 0 Grade 3 1 1 1 0 Grade 4 1 1 0 0

Disclaimer

We may update our documentation occasionally, but will only do so in a way that does not negatively affect the features and functionality of the Anaplan service.