mean
Returns the mean (average value) for a set of numbers.
The input can be a list or table region (e.g. a column).
The second parameter controls how to handle null or empty values.
Parameters
INPUT LIST (list or table region)
A list or table region of numbers.
IGNORE NULLS (Boolean)
Optional. Whether to ignore null or empty values (true) or count them as a zero (false).
Default: true
Examples
The function can take a list of numbers.
ATL in Script | Result |
---|---|
| 3 |
Set the second parameter to false to count null values as zeros.
ATL in Script | Result |
---|---|
| 3 |
| 2.5 |
Using mean with table data
Assume a "Describe the Table" project with this data:
Branch | Orders | salesRev | COGS | otherRev | otherExp | netProfit | |
---|---|---|---|---|---|---|---|
Row 1 | Aberdeen | 15 | 14,000 | 8,000 | 2,000 | 1,500 | 6,500 |
Row 2 | Edinburgh | 35 | 33,000 | 19,000 | 2,000 | 3,500 | 12,500 |
Row 3 | Inverness | 18 | 16,000 | 1,200 | 1,500 | 7,450 | |
Row 4 | Glasgow | 35 | 32,500 | 17,750 | 1,250 | 1,700 | 14,300 |
The function can take a column variable.
ATL in Script | Result |
---|---|
| 23,875 |
Set the second parameter to false to count empty values as zeros.
ATL in Script | Result |
---|---|
| 14,916.67 |
| 11,187.50 |
Note
In a "Describe Row in Context" project, the column variables are salesRevColumn
and COGSColumn
.