111
Building CLEM Expressions
Characters—Always use single backquotes like this `. Fo re xample, note the character din
the function stripchar(`d`,"drugA"). The only exception to t his is when you are using an integer
to refer to a specic character in a string. For example, n ote the character 5in 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). Youcan use single quotes when necessary to enclose spaces or other special
characters ('Order Number'). Fields that are q uoted but undened 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 c an evaluate true or false (used when selecting on a condition)—for example:
Drug= "drugA"
Age< 16
not(PowerFlux)and Power > 2000
Youcan combine operators and fun ctions 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: xhas higher precedence than +.
Finally, Baseline is added to the result.
The descending order of precedence (that is, operations that are performed rst to opera tions
that are performed last) is as follows:
Function arguments
Function calls
xx
x / mod div rem
+ –
> < >= <= /== == = /=