
137
CLEM Language Reference
Function Result Description
max_n(LIST) Number
Returnsthe m aximum value from a list of numeric fields or
nullif all of the field valu es are null. For more information,
see the topic Summarizing Multiple Fields in Chapter 7
on p. 115.
member(ITEM,LI ST) Boolean
Returns true if ITEM is a member of the specified LIST.
Otherwise, a false value is returned. A list of field names
can also be specified. For more information, see the
topicSu mmarizing Multiple Fields in Chapter 7 on p. 115.
min(ITEM1,ITEM 2) Any Returns the lesser of the twoite ms—ITEM1 or ITEM2.
min_index(LIST) Integer
Returns the index of the field containing the minimum
value from a list of numeric fields or 0 if all values are
null. For example, if the third field listed contains the
minimum, the index value 3 is returned. If multiple fields
contain the minimum value, the one listed first (leftmost)
is returned. For more information, see the topic Working
with Multiple-Response Data in Chapter 7 on p. 117.
min_n(LIST) Number Returns the minimum value from a list of numeric fields or
null if all of the field values are null.
time_before(TIME1,
TIME2) Boolean Used to check the ordering of time values. Returns a true
value if TIME1 is before TIME2.
value_at(INT,LIST)
Returns the value of each listed field at offset INT or
NULLi f the offset is outside the range of valid values (that
is, less than 1 orgr eater thanth enum berof list edfields).
All storage types supported.
Logical FunctionsCLEM expressions can be used to perform logical operations.
Function Result Description
COND1and COND2 Boolean
This operation is a logical conjunction and returns a true
value if both COND1 and COND2 are true. If COND1 is
false,then CO ND2 is not evaluated; this makes it possible
to have conjunctions where COND1 first tests that an
operation in COND2 is legal. For example, length(Label)
>=6 and Label(6) = 'x'.
COND1or COND2 Boolean
This operation is a logical (inclusive) disjunction and
returns a true value if either COND1 or COND2 is true
or if both are true. If COND1 is true, CO ND2 is not
evaluated.
not(COND) Boolean
This operation is a logical negation and returns a true
value if COND is false. Otherwise, this operation returns
a value of 0.
if COND then EXPR1 else
EXPR2en dif Any
This operation is a conditional evaluation. If COND
is true, this operation returns the result of EXPR1.
Otherwise, the result of evaluating EXPR2 is returned.
ifCOND1 then E XPR1 elseif
COND2 then EXPR2 else
EXPR_Nen dif
Any
This operation is a multibranch conditional evaluation.
If COND1 is true, this operation returns the result of
EXPR1. Otherwise, if COND2 is true, this operation
returns the result of evaluating EXPR2. Otherwise, the
result of evaluating EXPR_N is returned.