Use comparison functions in formula expressions - AWS IoT SiteWise

Use comparison functions in formula expressions

In transforms and metrics, you can use the following comparison functions to compare two values and output 1 (true) or 0 (false). AWS IoT SiteWise compares strings by lexicographic order.

Function Description

gt(x, y)

Returns 1 if x is greater than y, otherwise 0 (x > y).

This function doesn't return a value if x and y are incompatible types, such as a number and a string.

gte(x, y)

Returns 1 if x is greater than or equal to y, otherwise 0 (x ≥ y).

AWS IoT SiteWise considers the arguments equal if they are within a relative tolerance of 1E-9. This behaves similar to the isclose function in Python.

This function doesn't return a value if x and y are incompatible types, such as a number and a string.

eq(x, y)

Returns 1 if x is equal to y, otherwise 0 (x == y).

AWS IoT SiteWise considers the arguments equal if they are within a relative tolerance of 1E-9. This behaves similar to the isclose function in Python.

This function doesn't return a value if x and y are incompatible types, such as a number and a string.

lt(x, y)

Returns 1 if x is less than y, otherwise 0 (x < y).

This function doesn't return a value if x and y are incompatible types, such as a number and a string.

lte(x, y)

Returns 1 if x is less than or equal to y, otherwise 0 (x ≤ y).

AWS IoT SiteWise considers the arguments equal if they are within a relative tolerance of 1E-9. This behaves similar to the isclose function in Python.

This function doesn't return a value if x and y are incompatible types, such as a number and a string.

isnan(x)

Returns 1 if x is equal to NaN, otherwise 0.

This function doesn't return a value if x is a string.