Field names
Reference fields, or columns, by prefixing their name with a dollar sign$.
".
Literals
Strings
String literals are enclosed in double quotes ("a string") and support interpretation.
Special characters are escaped with a backslash \.
Within the quotes, any character may appear except newline ("\n") and unescaped double quote ("\\") which require the use of the backslash character.
Raw strings
Raw string literals are enclosed in single back ticks (`a raw string`).
Within the quotes, any character may appear except a back quote.
This is useful for expression of text that use the backslash character.
For example, file paths and regular expressions.
Integers and floating point numbers
Positive or negative whole numbers or floating point numbers. E notation style numbers are also supported.Booleans
A truthy value represented withtrue and false false.
Null
An empty, missing value represented withnull.
Operators
Calculated fields support infix arithmetic, logical, and comparison operators. Add spaces around infix operators, otherwise your expression may not evaluate how you expect. For example:$column+5returns the value of a field namedcolumn+5.$column + 5returns the sum of five and thecolumnfield’s value.
Arithmetic operators
| Operator syntax | Equivalent function |
|---|---|
$a + $b | SUM($a, $b) |
$a - $b | SUB($a, $b) |
$a * $b | MUL($a, $b) |
$a / $b | DIV($a, $b) |
$a % $b | MOD($a, $b) |
Comparison operators
| Operator syntax | Equivalent function |
|---|---|
$a = $b | EQUALS($a, $b) |
$a != $b | NOT(EQUALS($a, $b)) |
$a < $b | LT($a, $b) |
$a <= $b | LTE($a, $b) |
$a > $b | GT($a, $b) |
$a >= $b | GTE($a, $b) |
Logical operators
| Operator syntax | Equivalent function |
|---|---|
$a AND $b | AND($a, $b) |
$a OR $b | OR($a, $b) |
!$a (also !($a)) | NOT($a) |