IBM 15 Switch User Manual


 
111
Building CLEM Expressions
Characters
—Alwa ys use single backquotes like this ` . For example, note the character d in
the fun ction stripchar(`d`,"drugA"). The only exception to this is when you are using a n integer
to refer to a sp
ecic character in a string. For example, note th e character 5 in the function
lowertoupper("druga"(5)) —> "A". Note: On a standard U.K. and U.S. keyboard, the key for the
backquote character (grave ac cent, Unicode 0060) can be found just below the Esc key.
Fields
—Fields are typically unquoted when used in CLEM expressions (subscr(2,arrayID))
—> CHAR). You
can use single quotes when necessary to enclose spaces or other special
characters ('Order Number'). Fields that are quoted but undened in the data set will be
misread as strings.
Parameters
—Alwa ys use single quotes ('$P-threshold').
Expressions and Conditions
CLEM expressions can return a result (used when deriving new values)—for example:
Weight * 2.2
Age + 1
sqrt(Signal-Echo)
Or, they c an evaluate true or false (used when selecting on a condition)—f or example:
Drug = "drugA"
Age < 16
not(PowerFlux) and Power > 2000
You can combine operators and functions arbitrarily in CLE M expressions—for ex
ample:
sqrt(abs(Signal)) * max(T1, T2) + Baseline
Bracke ts and operator precedenc e determine the ord er in whic h the expr ession is evalua ted. In this
example, the order of evalua tion is:
abs(Signal) is evaluated, and sqrt is applied to its result.
max(T1, T2) is evaluated.
The two results are multiplied: x has higher precedence than +.
Finally, Baseline is added to the result.
The descending order of precedence (that is, operations that are performed rst to operations
that are performed last) is as follows:
Functi on arguments
Functi on calls
xx
x / mod div rem
+
> < >= <= /== == = /=