Skip to main content
Skip table of contents

Compare to Constant

The Compare to Constant criterion allows you to create a criterion that compares an attribute against a constant value that you provide.

The following criterion properties must be defined:

  • Operator: defined using a drop-down list that contains the following values:

    • is equal to

    • does not equal

    • is less than

    • is less than or equal to

    • is more than

    • is more than or equal to

  • Value: you must provide a constant value against which to compare the attribute.   The data type of the constant must be appropriate for the data type of the attribute upon which the criterion is based.  Valid constants are:

    • String: all constants appropriate

    • Integer: only integer constants appropriate

    • Decimal: only numeric constants appropriate. Support is provided for 6 decimal points of precision.

    • Date/time: only date/time constants appropriate (a date picker control is provided if creating a criterion based on a date/time attribute).

If you choose not to specify a constant, you are effectively supplying a blank value (this applies only to string attributes).

Compare to Constant – Date/time Attribute

When creating a constant comparison criterion in respect of a date/time attribute, an extra operator value (is within) is made available. The following fields are shown if it is selected:

  • [value]: mandatory and integer only.

  • [unit of time]: a drop-down list containing the values:

    • Seconds (the default)

    • minutes

    • hours

    • days

    • days (ignore time)

    • months

    • years

  • [preposition]: a drop-down list containing the values:

    • of

    • before

    • after

In addition, an extra button (Toggle using the start date/time of the workflow) is displayed:

If this button is selected…

…[date/time] is removed from display and replaced with the label that reads ‘the date/time the workflow starts’.

You can use this feature to target records with a value for a date/time attribute that is compared to a constant defined by the point at which an interaction workflow within which the standard selection rule is executed begins. For example, you might wish to only retrieve records where a purchase has been made within a month of a workflow commencing execution. When executed in the Rule Designer, the date/time value defaults to the current date and time.

Compare to Constant – Value/Translation

This option is only available if the attribute’s data type is not date/time or decimal.

By default, when you specify a constant value when building a constant comparison criterion you are comparing that value against the raw data as stored in the data warehouse or auxiliary database.

When you click the Value button, its label is replaced with Translation, and the existing constant field is replaced with a drop-down list.

This list is populated with up to 100 of the most common distinct values for the field.

Population of the list is carried out by the RPI server, and the values are cached for subsequent use.

If you elect to use translation values, rather than supplying a constant directly, and the values list has not been cached at the server, the list is populated (which may take from a few seconds to several minutes, depending on the size of the underlying data warehouse or auxiliary database table).

If the attribute’s values have already been cached, and the attribute has been used to create a constant or list comparison criterion in your current RPI session, the message is not shown and values are loaded instantaneously upon electing to use translations.

If the values have been cached, but you have not used the attribute to create a constant or list comparison criterion in your current RPI, the message is still shown, but values are loaded immediately upon electing to use translations.

For each distinct value, the translation value is displayed to the left and its and raw value, italicized, to the right. If no translation value has been provided, the raw value is displayed instead. Values are listed alphabetically by translation.

When you choose a value from the list, if a translation was provided, it is displayed within the criterion within the standard selection rule.

Clicking the Translation button again reverts to the default Value display.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.