Compare to List
Overview
The Compare to List criterion allows you to create a criterion that compares an attribute against one or more values that you select from a list.
![](../__attachments/3904936623/att_6_for_3861839996.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
When creating a new or configuring an existing Compare to List criterion, the Criterion Builder contains:
Label
“[AttributeName] is in the list of selected values”
Values
Lists the distinct values that exist for the attribute, which have not yet been selected for inclusion within the criterion.
Population of the list of available Values is carried out by the RPI server, and they are cached for subsequent use. If the Values list has not yet been cached at the server, the following is displayed:
![](../__attachments/3904936623/att_7_for_3861839996.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
The list is populated when you select Start loading values, which results in the creation of a Cache attribute values job (the My Jobs dialog is not shown). Execution of this job 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, the message is not shown and Values are loaded instantaneously.
If you wish, you can limit the list of a string attribute’s displayed Values by entering a search criterion in the field at the top:
![](../__attachments/3904936623/att_1_for_3861839996.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
When you do so, the system displays values that contain the string supplied. The search is carried out against the locally-cached values. Having limited the displayed Values in this way, you can invoke Clear Search to redisplay the original values list.
Note that limiting the values displayed in this way is not available for attributes with translations.
The Values list contains a Count column alongside the Values column, which displays the number of occurrences of the value in question within the attribute. In addition, a button displayed to the right of the Count column allows you to retrieve an up-to-date count of the occurrences of values within the column:
The number of values listed is constrained by system configuration setting AttributeValueListSize. If the number of values displayed is less than the number of distinct values that exist, the top [n] values by frequency are shown. A message is displayed below the Values grid:
![](../__attachments/3904936623/att_2_for_3861839996.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Note that the Null value is available for all attribute types other than aggregation and flag.
Blank string values are shown as e.g. “[1 space]”.
By default, values are sorted as per the most recent invocation of the list Criterion Builder. You can sort the Values by Value or Count by selecting on the appropriate column header. Selecting again reverses the sortation. Any sortation you apply continues to be maintained after entering a search criterion and limiting the Values displayed.
When the number of Selected Values reaches MaxValuesCompareToList
, a message is displayed at the bottom:
![](../__attachments/3904936623/att_3_for_3861839996.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
In addition, the following buttons are unavailable:
Add new Custom Value
Paste Values from Clipboard
If you paste in values such that number of Selected Values exceeds the configuration setting, only the permissible number of values are pasted, and an informational message is displayed.
Double-clicking a value in the Values list adds it to the Selected Values list. The value in question continues to be shown in the Values list; double-clicking it again has no effect.
Add
The top of the two buttons displayed between the Values and Selected Values list is available when at least one value is selected in the Values list. Invocation adds the value(s) to the Selected Values list. Attempting to add a value already in Selected Values list has no effect.
Remove
The bottom of the two buttons displayed between the Values and Selected Values list is available when at least one value is selected in the Selected Values list. Invocation removes the value(s) from the Selected Values list.
Selected Values
This section consists of a toolbar and the selected values list itself.
Toolbar: exposing the following options:
Add new custom value: selecting this button displays the Add Custom Value dialog. The dialog allows you to specify a custom value that is not shown in the Values list. Entry of the value is effected using a data-type specific control. Selecting Add the new value, at the bottom of the dialog, adds the custom value to the list of Selected Values. If the value specified is already present in the list, a warning is displayed. Selecting the Cancel button removes the dialog from display.
Note: Add new custom value is not available for Boolean attributes.
Copy values to clipboard: this button is available when one or more selected values are present in the Selected Values list. Selecting it copies the values in question to the clipboard. Null values are not copied. Copy is not available at Boolean attributes.
Paste values from clipboard: invocation of this option displays a submenu:
Replace existing Values: selecting this option removes the existing Selected Values, and replaces them, with values pasted from the clipboard.
Add to existing Values: selecting this option appends the contents of the clipboard to the Selected Values list. Values are pasted in appropriate alphabetical positions. Any existing or duplicate values are not added, and a warning message is displayed.
Note that data pasted must be compatible with the criterion's attribute's data type. Paste is not available at Boolean attributes. Values pasted must be database values, not translations.
List: the Selected Values list displays the values selected for the criterion. Where a translation exists for the value, the value is shown as "[Value]([Translation])".
When you select a blank value, the selected value is shown as “(blank value)”. If the value actually contains one or more spaces, it is shown as “([n] spaces)”.
Values are listed in ascending alphabetical order, irrespective of the order in which they were added. Double-clicking a value in the Selected Values list removes it from the list. You must select at least one value for a list criterion.
Note:
You cannot create a compare to list criterion based on an attribute that references other attributes as arguments (e.g. a function attribute).
You cannot create a compare to list criterion based on a function attribute that references a constant.