Compare criterion
Compare to Range
The Compare to Range criterion allows you to create a criterion that compares an attribute against a range of values.
![](../__attachments/3904936674/att_1_for_3861545116.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
The following criterion properties must be defined:
“From” and a “to” values: the data type of the values must be appropriate for the data type of the attribute upon which the criterion is based:
String: all values appropriate.
Integer: only integer values appropriate.
Decimal: only numeric values appropriate.
Date/time: only date/time values appropriate (note that date picker controls are provided if creating a criterion based on a date/time attribute).
Note that range values are inclusive.
Note that, if running RPI against a Splice Machine data warehouse, that database’s lexicographic ordering of strings has the potential to impact a standard selection rule's count results when performing a range comparison between numeric values stored as strings.
Compare to Attribute
The Compare to Attribute criterion allows you to create a criterion that compares an attribute against another attribute—for example, you might be interested in the first product a customer bought; this could be achieved by comparing a “Purchase date” attribute to a “Date became customer” attribute.
![](../__attachments/3904936674/att_2_for_3861545116.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
The following criterion properties must be defined:
Operator: select an operator 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
is within (datetime attribute only)
Attribute: either drag the attribute that you wish to compare against the first attribute into the field to the right of the dialog or browse for an appropriate attribute using the recent items chooser or File System Dialog. Note that the attribute you drag in must be compatible with the data type of the attribute that the new criterion is based upon—if it is not, a warning message is displayed and you will not be able to add it. Also note that you cannot compare an attribute to itself; nor can you compare an attribute to an Exists in Table or Aggregate attribute. It is, however, possible to compare attributes with different resolution tables (provided that the joins linking them are configured correctly).Having provided an attribute, you can view its details in the File Information dialog or clear it. A warning message is displayed if you attempt to select a cross-database Attribute in this context.
When dragging an attribute into a standard selection rule to create a compare to attribute criterion, if the attribute to which it is to be compared is a Placeholder attribute at which Use Sys Variable has been checked, on viewing the Test Attribute Placeholders dialog, the system variable's value is displayed as default only if exposing system variable values. For more information on system variables, please see the Framework documentation.
Compare to Relative Date
The Compare to Relative Date criterion is available only when creating a criterion based on a date or date/time attribute.
![](../__attachments/3904936674/att_3_for_3861545116.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
It allows you to create criteria that compare a date interval against the time at execution—for example, “[attribute] is 1 month before the current time” or “[attribute] is within 5 years of the current time”.
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 within
Is less than
Is less than or equal to
Is more than
Is more than or equal to
Is
If any value other than “Is within” or “Is” is selected, the label “the current time” is displayed to the right hand side of the drop-down.
If “Is within” is selected, you must define the following additional properties:
[value]: a mandatory field that may be populated only with an integer value.
[unit of time]: a drop-down list containing the values:
Seconds (the default)
minutes
hours
days
days (ignoring time)
Available at datetime attributes only
months and years
[preposition]: a drop-down list containing the values of:
before
after
The label “the current time” is displayed to the right hand side of [preposition].
If “Is” is selected, you must specify a value at an additional property:
[unit of time]: a drop-down list exposing the following values:
Today
Yesterday
Tomorrow
This week
Last week
This month
Last month
Next month
This year
Last year
If set, values are calculated using the time zone specified in system configuration setting RuleTimezoneOverride
. If blank, the server time zone is used.
Compare to Relative Date Range
The Compare to Relative Date Range criterion is available only when creating a criterion based on a date or date/time attribute.
![](../__attachments/3904936674/att_7_for_3861545116.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
It allows you to create a criterion that specifies that matching attribute values are between a defined Start and End relative to the point of the rule’s being run. The Relative Date Range Criterion Builder contains the following:
Start section: containing the following:
[Dropdown]: this dropdown field exposes the following values:
Is now
Is before now (the default)
Is after now
Has no limit
Duration: this integer property is only shown when [Dropdown] one of Is Before Now or Is After Now. It defaults to the value 1, and accepts a minimum value of 1, and a maximum value of 999,999.
[Units]: this dropdown field exposes the following values:
seconds
minutes
hours
days
months
years
End section: containing the same properties as Start.
“No limit” values at Start and End are not supported concurrently. Any values configured at the criterion must make sense from a temporal perspective.
When a compare to relative date range criterion is shown at a standard selection rule, if reflects its configuration as defined in the Criterion Builder.
Note that the Compare to Relative Date Range criterion is not supported at Google BigQuery when a date field's Mode property is set to "Repeated".