User's Manual
153
CLEM Language Reference
Function
Result
Description
@MAX(FIELD, EXPR)
Number
Returns the maximum value for FIELD over the last
EXPR records received so far, i ncluding the current
record. FIELD must be the name of a numeric field.
EXPR may be any expression evaluating to an i nteger
greater than 0 .
@MAX(FIELD, EXPR, INT)
Number
Returns the maximum value for FIELD over the last
EXPR records received so far, i ncluding the current
record. FIELD must be the name of a numeric field.
EXPR may be any expression evaluating to an i nteger
greater than 0. If EXPR is omitted, or if it exceed s the
number of records received so far, the maximum value
over all of the records re cei ved so far is returned.
INT specifies the maximum number of values to look
back. This is far more efficient than using just two
arguments.
@MIN(FIELD
)
Number
Returns the minimum value for th e specified FIELD.
@MIN(FIELD, EXPR)
Number
Returns the minimum value for FIELD over the last
EXPR records received so far, i ncluding the current
record. FIELD must be the name of a numeric field.
EXPR may be any expression evaluating to an i nteger
greater than 0 .
@MIN(FIELD, EXPR, INT)
Number
Returns the minimum value for FIELD over the last
EXPR records received so far, i ncluding the current
record. FIELD must be the name of a numeric field.
EXPR may be any expression evaluating to an i nteger
greater than 0. If EXPR is omitted, or if it exceed s the
number of r ecords received so far, the min i mum value
over all of the records re cei ved so far is returned.
INT specifies the maximum number of values to look
back. This is far more efficient than using just two
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
offset refers to a record that has already p assed, while
a negative one specifies a “lookahead” to a record that
has yet t o arrive. Fo r example, @OFFSET(Status, 1)
returns the value of the Status field in t he 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 specified as a constant. For positive offsets only,
EXPR may also be an arbitrary CLEM expressio n,
which is evaluated for the current record to give the
offset. In th i s case, the three -argument version of
this function should improve performance (see next
function). If the expression returns anything other
than a non-negative integer, this causes an error—that
is, it is not legal t o have calculated lookahead offsets.
Note: A self-ref erential @OFFSET function cannot use
literal lookahead. For example, in a Filler node, you
cannot replace the value of field1 using an expression
such as @OFFSET(field1,-2).