152
Chapter 8
For this reason, @SINCE does not evaluate its condition for the current record. Use a similarfunction, @SINCE0, if you want to evaluate the condition for the current record as well as previo usones; if the condition is true in the current record, @SINCE0 returns 0.
Note: @ functions cannot be called from scri pts.
Function Result Description
MEAN(FIELD) Real Returns the mean average of values for the specied
FIELD or FIELDS.
@MEAN(FIELD, EXPR) Real
Returns the mean average of values for FIELD over
the last EXPR records received by the current node,
includingthe current r ecord. FIELD must be the name
of a numeric eld. EXPR may be any expression
evaluating to an integer greater than 0. If EXPR is
omittedor if it exceeds thenumber of records received
so far,th e average over all of the records received
so far is returned. Note that this function cannot be
called from a script.
@MEAN(FIELD,EXP R, INT) Real
Returns the mean average of values for FIELD over
the last EXPR records received by the current node,
includingthe current r ecord. FIELD must be the name
of a numeric eld. EXPR may be any expression
evaluating to an integer greater than 0. If EXPR is
omittedor if it exceeds thenumber of records received
so far,the average over all of the records r eceived so
far is returned. INT species the maximum number
ofv alues to look back. This is far more efcient than
using just two arguments.
@DIFF1(FIELD) Real
Returns the rst differential of FIELD1. The
single-argument form thus simply returns the
differencebetwee nt he current value and the previous
value of the eld. Returns 0 if the relevant previous
records do not exist.
@DIFF1(FIELD1,FI ELD2) Real
The two-argument form gives the rst 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
differencebetwee nt he current value and the previous
value of the eld. Returns 0 if the relevant previous
records do not exist
@DIFF2(FIELD1,FI ELD2) Real
The two-argument form gives the rst 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
allocated to records as they arrive at the current node.
The rst record is given index 1, and the index is
incremented by 1 for each subsequent record.
@LAST_NON_BLANK(FIELD) Any
Returns the last value for FIELD that was not blank,
as dened in an upstream source or Typeno de.
If there are no nonblank values for FIELD in the
records read so far,$nu ll$ is returned. Note that blank
values,also called u ser-missingvalu es, can be dened
separately for each eld.
@MAX(FIELD) Number Returns the maximum value for the specied FIELD.