IBM 15 Switch User Manual


 
155
CLEM Language Reference
Function
Result
Description
@SUM(FIELD, EXPR)
Number
Returns the sum of values for FIELD over the last
EXPR records received by the current node, including
the current record. FIELD must be the name of
a numeric eld. EXPR may be any expression
evaluating to an integer greater than 0. If EXPR
is omitted, or if it exceeds the number of records
received so far, the sum over all of the records
received so far is returned.
@SUM(FIELD, EXPR, INT)
Number
Returns the sum of values for FIELD over the
last EXPR records received by the current node,
including the current record. FIELD must be
the name of a numer i c eld. EXPR may be any
expression evaluating to an integer greater than 0.
If EXPR i s omitted, or if it e xceeds the number
of records received so far, the sum over all of the
records received so far is returned. INT species the
maximum number of values to look back. This is far
more efcient than using just two arguments.
@THIS(FIELD)
Any
Returns the value of the eld named FIELD in the
current record. Used only in @SINCE expressions.
Global Functions
The functions @MEAN,@SUM, @MIN, @MAX, and @SDEV work on, at most, all of the records
read up to and including the current one. In some cases, however, it is useful to be able to work
out how values in the current record compare with values seen in the entire data set. Us ing a
Set Globals node to generate values across the entire data set, yo u can access these values in a
CLEM expression using the global functions.
For exa mple,
@GLOBAL_MAX(Age)
returns the highest value of Age in the data set, while the expression
(Value - @GLOBAL_MEAN(Value)) / @GLOBAL_SDEV(Value)
expresses the difference between this record’s Value and the global mean as a number of standard
deviations. You can use global values only after they have been calculated by a Set Globals
node. All current global values can be canceled by clicking the Clear Global Values button on the
Globals tab in the stream properties dialog box.
Note: @ functions cannot be called from scripts .
Function
Result
Description
@GLOBAL_MAX(FIELD)
Number
Returns the maximum val ue for FIELD over the whole
data set, as previously generated by a Set Globals node.
FIELD must be the name of a numeric eld. If the
correspon ding global val ue h as not been set, an error
occurs. Note that this function cannot be called from a
script.