MEAN macro
The MEAN
macro
is available in Unica Campaign and Unica Interact.
Syntax
MEAN(data [, keyword])
Parameters
data
The
numerical values to compute the arithmetic mean of. This can be a
constant value, a column, a cell range, or an expression evaluating
to any of the above. For the format definition of data
,
see the "Macro Function Parameters" section in the chapter
in this guide for your product.
keyword
This optional keyword determines how the computation is performed over the input data range. Select one of the following:
ALL
-
Performs the computation on all cells in data
(default)
COL
-
Performs the computation separately for each column of data
ROW
-
Performs the computation separately for each row of data
See DATE for more details on using keywords.
{ALL | COL | ROW}
. These
keywords do not apply in
Unica Campaign
because the input data is always a single column or field. The
macro will always behave as if the COL
keyword were
specified. Therefore, you do not need to specify these keywords when
using
Unica Campaign .Description
MEAN
calculates
the arithmetic mean or average of the cells in the specified data
range. The arithmetic mean is calculated by summing the contents of
all cells divided by the number of cells. The number of columns returned
by MEAN
depends on keyword
.
- If
keyword
isALL
,MEAN
returns one new column, containing a single value (the average of all cells indata
). - If
keyword
isCOL
,MEAN
returns a new column for each input column. Each new column contains one value (the average of all cells in the corresponding input column). - If
keyword
isROW
,MEAN
returns one new column containing the average across each row ofdata
.
MEAN
is the same as the AVG
macro
function.Examples
TEMP = MEAN(V1) Creates a new column named |
TEMP = MEAN(V1:V3) Creates a new column
named |
TEMP = MEAN(V1[10:20])
Creates a new column named |
TEMP = MEAN(V1[1:5]:V4)
Creates a new column named |
TEMP = MEAN(V1:V3, COL)
Creates three new columns named |
TEMP = MEAN(V1[10:20]:V3, COL) Creates
three new columns named |
TEMP = MEAN(V1:V3, ROW) Creates
a new column named |
TEMP = MEAN(V1[1:5]:V3,ROW) Creates
a new column named |
Related functions
Function | Description |
---|---|
SUM or TOTAL |
Computes the sum of a range of cells |