Reference: Boolean Expressions
A boolean expression is an expression that evaluates to true or false. You can use the Prism
expression language to write boolean expressions in:
- Filter expressions. Use Advanced mode when configuring a dataset Filter stage.
- Custom example rule expressions. Use Advanced mode when configuring a rule for the dataset custom example.
- Prism calculated fields. Example: Use a boolean expression in the CASE function.
The typical format of a boolean expression is:
field_namecomparison_operatorcomparison_value
The comparison value must be of the same field type as the field in the
expression.
You can also use logical operators (such as AND and OR) or arithmetic operators (such
as + or /) to define more complex expressions.
When the field name includes a space or a special character, enclose the field name in square
brackets:
[ticker symbol]
.When the comparison value is for a Text field type, enclose the value in double
quotes (""). Example:
[Zip Code] = "94111-5224"
Comments in Expressions
You can insert single and multiline comments into any location within a Prism
expression. Workday treats all text between these characters as comments: /* */
Workday won't consider the
data values as comments if you enclose these characters and the comment within
double quotation marks.
Text Field Examples
[movie title] LIKE ("* and the*") [contingent workers] IN ("Larry", "Curly", "Moe") schedule NOT IN ("Saturday", "Sunday") status IS NOT NULL
Numeric and Currency Field Examples
TO_STRING([zip code]) LIKE("94*") [sale price] < 50.00 age >= 21 ((EXTRACT_AMOUNT([Total Sales]) > 1000) AND (EXTRACT_CODE_TEXT([Total Sales]) == "USD"))
Date Field Examples
[purchase date] BETWEEN 2019-06-01T00:00:00.000Z AND 2019-07-31T00:00:00.000Z [graduation] >= 1990-01-01
Instance and Multi-Instance Field Examples
INSTANCE_IS_SUPERSET_OF([Cost Center - Manager], [Cost Center]) [Cost Center] IS EMPTY [Journal Lines] IS NOT NULL [Cost Center 1] != [Cost Center 2] NOT INSTANCE_EQUALS([Cost Center 1], [Cost Center 2]) INSTANCE_CONTAINS_ANY([Regions], "070b0d082eee44e1928c808cc739b35f", "f4c49debb3dc483baa8707dfe683503c")
Boolean Expressions on Date Type Fields
Boolean expressions on Date type fields must be in either of these formats:
yyyy-MM-ddTHH:mm:ss:SSSZyyyy-MM-dd
Don't enclose comparison values for Date fields in quotation marks or use any other
punctuation. If the date value is in Text format rather than Date format, the value
must be enclosed in quotes like all text values.
When specifying a range of dates, always write the earlier date first.
If the boolean expression is a shortened version of the full format, then any values
not included are assigned a value of zero (0). Example: the expression
BETWEEN 2019-06-01 AND 2019-07-31
is equivalent to this
expression:BETWEEN 2019-06-01T00:00:00.000Z AND 2019-07-31T00:00:00.000Z
The expression above doesn't include any values from July 31, 2019. To include values
from July 31, 2019, use
BETWEEN 2019-06-01 AND 2019-08-01
. Boolean Expressions on Currency Type Fields
Currency type fields in boolean expressions must be in a format recognized
by Workday. If a Currency field contains any value that doesn't meet these
requirements, Workday treats the value as NULL.
You can use multiple currency codes. Example:
((EXTRACT_CODE_TEXT([Annual Salary]) == "EUR") AND (EXTRACT_AMOUNT([Annual Salary]) >= 90000)) OR ((EXTRACT_CODE_TEXT([Annual Salary]) == "USD") AND (EXTRACT_AMOUNT([Annual Salary]) >= 100000))