Expression
Expression can contain the following components:
- references to other data set fields in the form of the fields names or earlier calculated expressions;
- references to the input port variables;
- brackets defining the order of operations execution;
- characters of mathematical operations and relations;
- logical operations (
and
,or
,not
,xor
) and values (true
or1
,false
or0
); - functions according to the syntactic description (refer to List of functions further);
- string expressions in quotation marks ("string expression");
- integer and real numbers;
- single-line and multi-line comments.
It is possible to use references to the expressions calculated earlier in the expression, namely, the expressions that are higher in the list of expressions. Consequently, incorrect list item position can cause a mistake.
Note: In the result of the mathematical operations with the "Date/time" type (addition, subtraction, etc.), the real number with fractional part can be got. By default, the operation result will be equal to the number of days (integer part) and hours (fractional part). For example: after such operation as
02.01.2020 12:00 - 01.01.2020 00:00
the result will be equal to1.5
- one full day (24 hours) and half a day (12 hours).
Caching
It is required to enable Caching in the Calculator expressions in the case of Data()
function usage for the recursive computation of values.
It is recommended to use Caching when using the functions result of which depends on the time point when this calculation is performed, for example: Random()
, Today()
, etc.
Quick Access Toolbar
The toolbar includes the buttons that enable to insert a template or preset layout into the expression code area upon their pressing.
Logical operations:
- AND: the Logical "AND" operator;
- OR: the Logical "OR" operator;
- NOT: the Logical "NOT" operator;
- XOR: the Logical "exclusive OR" operator.
Comparisons operator:
- = — Equals.
- <> — Not equal.
- < — Less than.
- > — Greater than.
- <= — Less than or equal to.
- >= — Greater than or equal to.
Templates:
- :
0.0
will be inserted to enter the real number. - :
""
will be inserted to enter the string. - :
StrToDate("____-__-__", "YYYY-MM-DD")
will be inserted to enter the date. - :
StrToDate("__:__:__", "HH:NN:SS")
will be inserted to enter the time.
Logical values:
- FALSE: the false value.
- TRUE: the true value.
Comments
To explain the received expression, calculator supports two types of comments:
- The single-line comment starts from
//
(two slashes) characters, and it continues until the end of the string. - The multi-line comment is represented by all characters included between
/*
(slash-asterisk) and*/
(asterisk-slash).
// Example of the single-line comment
IF(IsNull(gate_one),gate_two,gate_one) // single-line comment continues until the end of the string.
/* The multi-line comment
is represented by all characters
included between (slash-asterisk)
and (asterisk-slash). */