Chart data with expressions
- Last UpdatedSep 16, 2025
- 2 minute read
Note: Using expressions requires the "advanced" license feature to be enabled. If the advanced license is not available when an expression is used, no data is retrieved and an error message is displayed.
Expressions allow you to perform mathematical and logical operations on tag data.
What is an expression?
An expression is made up of a combination of the following elements:
-
Values
-
A value is made up of three components; a value with a base type of Boolean, integer, or double, along with a date and time in UTC format, and a 16-bit integer representing the OPC quality of the value.
-
Literal values are also supported, which have no date and time associated with them, and are always assumed to be "good" quality.
-
-
Streams
-
A stream is a time-ordered vector of values. A stream has either a stair-step or linear interpolation model, and an associated engineering unit.
-
In the context of an expression, one or more tags is the starting point for a stream, but the expression can produce additional streams derived from a tag. For example, the expression TI101.PV + 4.0 produces a result stream, but the starting point is the stream associated with TI101.PV.
-
-
Arithmetic and logical operators
-
Standard arithmetic operators such as addition, subtraction, multiplication and division are supported, along with logical operators for comparison, such as greater than (>) and less than (<). For a full list of supported operators, see Supported arithmetic operators.
-
-
Scalar functions
-
A variety of scalar functions are supported for manipulating data, such as calculating the absolute value, rounding values to the nearest integer, or unit of measure conversion. For a full list of supported scalar functions, see Supported scalar functions.
-
-
Time-series functions
-
A variety of time-series functions are supported for comparing data, such as calculating minimum/maximum values, or time in state. For a full list of supported functions, see Supported time-series functions.
-
Time intervals can be expressed in either of two ways:
-
As a number of days. For example, a value of 1 represents a daily period, while a value of 1/24 represents an hourly period. This is consistent with the way Microsoft Excel handles delta time values.
Note: Daily time periods support Daylight Savings Time. This means the "1 day" period is 24 hours, except on days when the Daylight Savings Time change is made, when it will be either 23 or 25 hours.
-
As a named period. The following named periods are supported: minute, hour, day, week, month, productionday, productionweek, productionmonth, utcday, utcweek, utcmonth, shift. These periods are anchored to a rounded time period. For example, "hour" produces hourly intervals where the minutes, seconds and milliseconds are all 0 in local time, while "minute" produces intervals where the seconds and milliseconds are all 0 in local time.
-
-