153
CLEM Language Reference
Function Result Description
@MAX(FIELD,EX PR) Number
Returns the maximum value for FIELD over the last
EXPR records received so far, including the current
record. FIELD must be the name of a numeric eld.
EXPRm ay beany express ionev aluating toa nin teger
greater than 0.
@MAX(FIELD,EXPR, INT) Number
Returns the maximum value for FIELD over the last
EXPR records received so far, including the current
record. FIELD must be the name of a numeric eld.
EXPRm ay beany express ionev aluating toa nin teger
greaterthan 0. If EXPR is omitted, or if it exceeds the
numberof records received so far, the maximum value
over all of the records received so far is returned.
INTsp eciesthe maximum number of values to look
back. This is far more efcient than using just tw o
arguments.
@MIN(FIELD)Number Returns the minimum value for the specied FIELD.
@MIN(FIELD,EXPR) Number
Returns the minimum value for FIELD over the last
EXPR records received so far, including the current
record. FIELD must be the name of a numeric eld.
EXPRm ay beany express ionev aluating toa nin teger
greater than 0.
@MIN(FIELD,EXPR, I NT) Numb er
Returns the minimum value for FIELD over the last
EXPR records received so far, including the current
record. FIELD must be the name of a numeric eld.
EXPRm ay beany express ionev aluating toa nin teger
greaterthan 0. If EXPR is omitted, or if it exceeds the
numberof reco rds received so far, the minimum value
over all of the records received so far is returned.
INTsp eciesthe maximum number of values to look
back. This is far more efcient than using just tw o
arguments.
@OFFSET(FIELD, EXPR) Any
Returns the value of FIELD in the record offset from
the current record by the value of EXPR. A positive
offsetrefers to a record that has already passed, while
anegative on e species a “lookahead” to a recordth at
has yet to arrive. For example, @OFFSET(Status, 1)
returns the value of the Status eld in the previous
record, while @OFFSET(Status, –4) “looks ahead”
four records in the sequence (that is, to records that
have not yet passed through this node) to obtain the
value. Note that a negative (look ahead) offset must
be specied asa co nstant. For positive offsets only,
EXPR may also be an arbitrary CLEM expression,
which is evaluated for the current record to give the
offset. In this case, the three-argument version of
this function should improve performance (see next
function). If the expression returns anything other
thana n on-negative integer, this causes an error—that
is,it is not leg al toh aveca lculated lookahead offsets.
Note: A self-referential @OFFSET function cannot use
literal lookahead. For example, in a Filler node, you
cannotre place the value offield1 u sing an expression
such as @OFFSET(field1,-2).