Working with Expressions
An expression operates on zero or more attributes, and can be used in a formula or multiformula, or as part of a statement in a script.
The effect of an expression is highly dependent on how it is used.
Overview
This topic introduces terminology used when working with expressions.
Expressions in Formulas and Scripts
The following image shows the expression in a formula (surrounded with a blue solid line). This expression consists of a function, upper()
, and the attribute or column you want to apply it to, name.
In a formula, you select the output column from a dropdown list: in this example, name_cleaned.
The following image shows the same expression (surrounded with a blue solid line) in a script.
When a script includes an output column for the result of the expression, name_cleaned in this example, collectively they are referred to as the named expression (surrounded with a pink dashed line).
Components of Expressions
Expressions can consist of any number of the following components:
- Functions
- Column names
- Literals
The image that follows shows valid expressions in several formulas.
The result of each of these example formulas is:
- 1 uses the literal
0
to populate thename_cleaned
output column. - 2 uses the values in the
name
column to populate thename_cleaned
output column. - 3 uses the
upper
function on thename
column to make values all uppercase and then uses the result to populate thename_cleaned
output column. - 4 uses the
upper
andconcat
functions on thefirst
andlast
columns with a literal' '
(space) between them to make values all uppercase and concatenate the resulting values together and then uses the result to populate thecompany_name
output column.
The topics in this section describe different types of expressions and provide examples of using expressions in context.
Updated over 2 years ago