IBM 15 Manual Do Utilizador

Página de 270
111
Building CLEM Expressions
Characters
—Always use single backquotes like this
` . For example, note the character d in
the function
stripchar(`d`,"drugA"). The only exception to this is when you are using an integer
to refer to a specific character in a string. For example, note the 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 accent, 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 undefined in the data set will be
misread as strings.
Parameters
—Always 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 can evaluate true or false (used when selecting on a condition)—for example:
Drug = "drugA"
Age < 16
not(PowerFlux) and Power > 2000
You can combine operators and functions arbitrarily in CLEM expressions—for example:
sqrt(abs(Signal)) * max(T1, T2) + Baseline
Brackets and operator precedence determine the order in which the expression is evaluated. In this
example, the order of evaluation 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 first to operations
that are performed last) is as follows:
Function arguments
Function calls
xx
x / mod div rem
+ –
> < >= <= /== == = /=