Date, Math, and Boolean expression components

Expression components evaluate customer data and return a value that can be used by other components. You can create similar logic by using inline expressions within components, but creating an expression component for frequently used calculations allows you to re-use this logic.

For example, you might want to create a Date expression that returns a date that is three weeks before the current date. You could use this component in multiple workspaces by copying it with a component reference.

When you configure expression components, you use the Expression Builder, which provides options appropriate for the expression type.

There are three expression components.

  • Date
  • Math
  • Boolean

Date components and dates in inline expressions

Date components return a single calendar date.

To create a date in a Date component, you select a date value as the first operand in the Expression Builder, and then add or subtract specified time periods. The date expression always has exactly one date value and one time period.

To create a rolling date in a Date component, you select Now for the first operand. For example, the expression Now - Period(1, Week) equals one rolling week prior to Now as defined in the trigger system. The expression Now - Period(1, Day) equals one rolling day prior to Now as defined in the trigger system.

To create a calendar date, you can use a time constant in a Date component or an inline expression, depending on the result you want to obtain. For example, Beginning of Current Week is the time constant for the beginning of the current calendar week, relative to Now as defined in the trigger system. You can use Beginning of Current Week in the following ways.

  • To obtain the beginning of two calendar weeks ago, use a Date component. In the date expression, select Beginning of Current Week as the first operand and subtract a one week time period.
  • To obtain the beginning of the current calendar week, use an inline expression within a component. For example, in a Select component, you use a WHERE clause to compare Beginning of Current Week with a transaction date.

    You cannot specify the beginning of the current calendar week with a Date component. The Date component can obtain the transaction date in an expression, but the only thing it can do with it is add or subtract some time span.