Expression evaluator functions

Syntax, descriptions, and return data types for various expression evaluator functions, including mathematical, logical, and string operations.
Function
Syntax
Description
Return data type
max
max(
value1
,
value2
,
value3
, ...)
Returns the greatest value.
Double
min
min(
value1
,
value2
,
value3
, ...)
Returns the lowest value.
Double
avg
avg(
value1
,
value2
,
value3
, ...)
Returns the average of the given values.
Double
abs
abs(
value
)
Returns the absolute value of the given number.
Double
trunc
trunc(
value
)
Returns the integer part of a decimal number.
Double
ceil
ceil(
value
)
Returns the approximated value by excess.
Double
floor
floor(
value
)
Returns the approximated value by defect.
Double
round
round(
value
)
Returns the approximation to the nearest integer.
Double
sqrt
sqrt(
value
)
Returns the square root of the given number.
Double
sign
sign(
value
)
Checks if the given floating point number is negative. Returns
0
if true or
1
if false.
Int32
like
like(
string_value
,
pattern
)
Applies only to String, QualifiedName, and LocalizedText
data types.
Returns
true
if the
string_value
parameter matches the
pattern
.
The
pattern
accepts the
%
wildcard at the beginning or at the end.
Examples:
  • like("motor23", "motor%")
    evaluates
    true
  • like("machine_2", "motor%")
    evaluates
    false
Boolean
isempty
isempty(
variable
)
Checks if a given NodeID, String, LocalizedText, or DataTime is empty.
Boolean
if
if(
condition
,
value_if_true
,
value_if_false
)
Checks if the
condition
is true and returns either
value_if_true
or
value_if_false
The syntax must meet these requirements:
  • For
    value_if_true
    and
    value_if_false
    , use parameters of the same data type.
  • For Boolean values, use lowercase
    true
    or
    false
    .
  • For colors, link to color values or use the
    0x
    AA
    RR
    GG
    BB
    syntax, where:
    • 0x
      is the hex notation
    • AA
      is the alpha channel (transparency)
    • RR
      is the red channel
    • GG
      is the green channel
    • BB
      is the blue channel
value_if_true
data type
left_of
left_of(string, pattern)
Returns the substring on the left of the first occurrence of the regular expression pattern.
IMPORTANT: Do not use wildcards in patterns.
String
right_of
right_of(string, pattern)
Returns the substring on the right of the first occurrence of the regular expression pattern.
IMPORTANT: Do not use wildcards in patterns.
String
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal