Attribute Comparison Metric

The Attribute Comparison Metric compares the values of two selected attributes based on an operator selected by the user, and returns a score of '100' (true) or '0' (false). Users are able to create an error message for instances when the metric returns a score of '0'; this message is meant to detail the reason for the '0' score and can have multiple translations.

Important: Metrics are used in conjunction with sufficiencies to determine the quality and completeness of a product's data. While this topic covers the functionality and configuration of the Attribute Comparison Metric, it is important that users are also familiar with sufficiencies and how they are combined with metrics. Information regarding sufficiencies can be found in the Sufficiency Configuration Type topic here.

Prerequisites

Before metrics can be created, a Setup Group must be configured. For information on configuring a setup group for metrics, refer to the Initial Setup for Metrics topic in the Metrics documentation here. For information on creating a metric, refer to the Creating and Editing Metrics topic in the Metrics documentation here.

Attribute Comparison Metric configuration

  1. From the Edit Metric Configuration wizard, select 'Attribute Comparison Metric.'

  1. With the Attribute Comparison Metric selected, click the ellipsis buttons () to select the attributes that you want to compare and select an operator from the 'Operator' dropdown list.

Once an operator is selected from the 'Operator' dropdown list, a default error message will appear in the 'Error Message' text field, based on the selected operator.

Operator options include:

  • Equal to
  • Not Equal to
  • Contained in
  • Greater than
  • Less than

Note: If the first attribute and/or second attribute has a value that is not a number, the 'Greater than' and 'Less than' operators will not be available.

In the example below, the user has selected 'Length' for the first attribute, 'Width' for the second attribute, and 'Equal to' for the operator. If the value for the first attribute is equal to the value for the second attribute, then the returned score will be '100' (true). If the value for the first attribute is not equal to the value of the second attribute, then the returned score will be '0' (false), and will be accompanied with a message, as displayed in the 'Error Message' text field.

Note: If the user selects an attribute that is not valid for a product, the metric will be considered non-applicable for that product and no data quality information will be produced when the Sufficiency Data Calculator event processor is run.

  1. To edit the error message and/or add additional translations, click on the 'Error Message' editor button.

The 'Edit messages' window appears. Note that the 'Message' text field is editable. Descriptive text below the text field describes in detail how the placeholders included in the error message work in order to create an error message. Although the default error message (or something similar) is suggested, users are able to edit the error message, depending on their individual needs.

Note: Although the error message can be edited by the user, the placeholders themselves (attribute_id and attribute_value) cannot be edited. If the placeholders are edited, the user will receive a validation error message when attempting to save the edited message. When the metric is run, placeholders are replaced by the 'real values,' e.g., 'attribute_id' would be replaced with the name of the attribute that the metric is evaluating.

  1. Select the 'Translations' flipper and click the green plus sign located next to 'Add translation.'

  1. Click on the arrow located in the 'Language' dropdown menu; in the example below, the user has opened the dropdown menu and selected 'French.'

  1. Once a language is selected, edit the message to reflect the language specified for translation.

  1. Click the green plus sign to add another translation or 'OK' to close the 'Edit messages' window.
  2. Click 'Save' to close the Edit Metric Configuration wizard.

The metric is saved.

Note: Translation error messages are displayed by using locales; they are not context-dependant. For more information about locales, refer to the Localization topic in the Administrative Portal documentation here. For more information about localized messages, refer to the Localized Messages for JavaScript Business Rules topic in the Business Actions documentation here.

Once the metric is added to a sufficiency and the sufficiency is run, the results are displayed in the sufficiency panel within the Web UI. In the example below, the Attribute Comparison Metric (for this example, titled 'AttMetComp') has been added to the sufficiency 'Product Measurement Requirements,' and returned a score of '0' because the attribute 'Length' value (9 in) is not equal to the attribute "Width' value (8 in), as detailed in the returned message.

Validation Errors

In certain instances, validation errors can occur, depending on the attributes selected for comparison. A validation error (accompanied by an error message) will occur if:

  • The selected attributes have the same ID.
  • One selected attribute is multivalued and the other selected attribute is not multivalued.
  • One selected attribute includes a unit and the other selected does not include a unit of measure.

In the example below, the first attribute 'Length' has units, whereas the second attribute 'keywords2' does not have units. Because of the incompatibility, a validation error occurs, with an error message that describes the reason for the error.

The following instances will also produce validation errors. However, these errors will not appear until the metric is run. The error message will appear in the Background Process Log of the Data Sufficiency Calculator event processor.

  • Both selected attributes have units, but one of the units does not have a set default unit, and no unit information is provided for the attribute value by the user (in the product).
  • Both selected attributes have units, but the units do not have the same base unit.
  • Both selected attributes have units, but one or both of the selected attributes do not have a base unit conversion rule.

For more information regarding units, including base units and conversion rules, refer to the Units topic in the System Setup documentation here.