Skip to main content

Data Types and Type Conversion Rules

Expression Systax: Data Types

The Digital Process Logic expression system uses three different data types:

  1. Scalar (one-dimensional): single values, including numeric, date/time, and string values
  2. Vector (two-dimensional): a list of scalar (individual) values
  3. Table (three-dimensional): a list of vector values

Most Digital Process Logic functions and operators specify particular data types, but are tolerant of using multiple types. If you provide a type other than the one specified for a given function or operator, DPL Studio attempts to process the type correctly, using the type conversion rules described below.

Type Conversion Rules

When you provide a value with an unexpected data type, DPL Studio sometimes must automatically convert from one type to another in order to process the expression. Specific rules govern the conversion when using functions, transform queries, and if-then statements/operators.

Functions

Most functions expect a scalar but will also accept a vector. If vector data is provided, the function evaluates each item in the source vector and return a new vector as the result.

Transform queries

The results of a transform query are always converted to a table, regardless of the data type returned by the expression.

If-then-else statement and operators

If-then-else statements and operators can take either scalar or vector type data. If one side of an operator is composed of vector data and the other side is composed of scalar data, the scalar value will be applied to all items in the vector. If both sides contain vectors, equal row indices will be evaluated. An if-then-else statement returns the appropriate then or else values in a vector the same length as the source vector.