152
Chapter 8
For this reason, @SINCE does not evaluate its condition for the current record. Use a similar
function, @SI
NCE0, if you want to evaluate the condition for the current record as well as previous
ones; if the condition is true in the current record, @SINCE0 returns 0.
Note: @ functions cannot be called from scripts .
Function
Result
Description
MEAN(FIELD)
Real
Returns the mean average of values for the specified
FIELD or FIELDS.
@MEAN(FIELD, EXPR)
Real
Returns the mean average of values for FIELD over
the last EXPR records recei ved by the current node,
including the current record. FIELD must be the name
of a numeric field. EXPR may be any expression
evaluating to an integer greater than 0. If EXPR is
omitted or if it exceeds t he num ber of records received
so far, the average over all of the records received
so far is returned. Note that this function cannot be
called from a script.
@MEAN(FIELD, EXPR, INT)
Real
Returns the mean average of values for FIELD over
the last EXPR records recei ved by the current node,
including the current record. FIELD must be the name
of a numeric field. EXPR may be any expression
evaluating to an integer greater than 0. If EXPR is
omitted or if it exceeds t he num ber of records received
so far, the average over all of the records received so
far is returned. INT specifies the maximum number
of values to look back. This is far more efficient than
using jus t two arguments.
@DIFF1(FIELD)
Real
Returns the first differential of FIELD1. The
single-argument form thus simply returns the
difference between the current value and the previous
value of the field. R et urns 0 if the relevant previ ous
records do not exist.
@DIFF1(FIELD1, FIELD2)
Real
The two-argument form gives the first differential of
FIELD1 with respect to FIELD2. Returns 0 if the
relevant previous records do not exist.
@DIFF2(FIELD)
Real
Returns the second differential of FIELD1. The
single-argument form thus simply returns the
difference between the current value and the previous
value of the field. R et urns 0 if the relevant previ ous
records do not exist
@DIFF2(FIELD1, FIELD2)
Real
The two-argument form gives the first differential of
FIELD1 with respect to FIELD2. Returns 0 if the
relevant previous records do not exist.
@INDEX
Integer
Returns the index of the current record. Indices are
alloc
ated to records as they arrive at the current node.
The first record is given index 1, and the index is
incremented by 1 for each subsequent record.
@LAST_NON_BLANK(FIELD)
Any
Returns the last valu e for FIELD that was not blank,
as defined in an upstream source or Type node.
If there are no nonblank values for FIELD in the
records read so far, $null$ is returned. Note that blank
values, also called user-missing values, can be defined
separately for each field.
@MAX(FIELD)
Number
Returns the maximum value for the specified FIELD.