Expression Tutorial
Columns
The same columns that can be selected to be part of the output can also be used in the expression text. The Format: TableName.ColumnName
Constants
Constant values of the usual data types can be used. Here are some examples...
- String: 'Lorem ipsum', 'o''Reilly' (quote-escaped)
- Boolean: false, true
- Number: 42, 12.34
- Date(Time): '2024-08-19', '2024-08-19 12:34:56', '2024-08-19 12:34:56.789', '2000-01-01T00:00:00Z''
- Time (not applicable to this demo): '12:34:56'
- Guid (not applicable to this demo): '11111111-aaaa-3333-BBBB-555555555555'
Comparing
The usual binary comparing operators are available: <, <=, ==, =, !=, <>, >=, >>
Please note: You will have to group individual comparings by using opening and closing parentheses, like so... (Customer.FirstName == 'John')
Logicals
Logical operations come in two flavors, namely unary and binary.
Unary
The 'negation'. It's symbol is the '!'. It acts on a single boolean expression.
Examples:
- !(Customer.IsPreferred = false)
- !(true = false)
Binary
Binary operations take two boolean expressions. The two types supported are 'AND' and 'OR'...Examples:
- ((Customer.IsPreferred = true) OR (YearsAgo(Customer.DateOfBirth) <= 25))
- (((Customer.FirstName = 'Jane') OR (Customer.FirstName = 'John')) AND (Customer.LastName == 'Doe'))
Math
The operators that can be used here are: +, -, *, /, %.
Examples:
- (1 + 2 * 3)
- ((1 + 2) / 4)
- (YearsAgo(Customer.DateOfBirth) - 20)
- -(10 * 20)
Parameters
These preset parameters have been included specifically in this demo...
- SalesTax: A number parameter, here valued '0.08'.
- StandardLastName: A string parameter, valued 'Doe'.
Methods
In this demo the following example methods have been provided...
- Today: Returns the current date (without the current time).
- Contains: A boolean that returns whether a string (param 1) contains a substring (param 2).
- YearsAgo: Takes a date and returns how many years ago that was.
- Not: A friendlier readable version of '!'.