Number of Referenced Target Objects Metric
The Number of Referenced Target Objects Metric detects the number of target objects of a selected reference type for a given product, and based on an operator selected by the user, returns either 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. For more information on reference types, refer to the Reference Types topic in the System Setup documentation.
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 Conditional Attribute Value Metric, it is important that users are also familiar with sufficiencies and how they are combined with metrics. Refer to the Sufficiency Configuration Type topic for information about sufficiencies.
Prerequisites
Before metrics can be created, a Setup Group must be configured to hold them. For information on configuring a setup group for metrics, refer to the Initial Setup for Metrics topic. For information on creating a metric, refer to the Creating and Editing Metrics topic.
Configuration
-
From the Edit Metric Configuration wizard, select 'Number of Referenced Target Objects Metric.'
-
Click the selector button (
) to select the reference type to evaluate, select an operator from the 'Operator' dropdown list, and input an integer in the 'Value' field. 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
-
Greater than
-
Less than
In the example screenshot above, the metric is set to determine if a product has more than '5' Primary Product Image references. If the product has more than five product image references, the metric will return a score of '100' (true). If there are fewer than five primary product image references, the metric will return a score of '0' (false), and will be accompanied with the message displayed in the 'Error Message' text field.
Note: A reference type that is not valid for a product is not applicable for that product and no data quality information will be produced when the Sufficiency Data Calculator event processor is run. Additionally, only integers are valid for the 'Value' field; non-integer characters input into the 'Value' field will result in a validation error when the user attempts to save the metric.
-
-
Click the 'Error Message' editor button (
) to display the 'Edit messages' dialog which allows you to edit the error message and/or add additional translations.
The 'Edit messages' window displays and the 'Message' text field is editable. Descriptive text below the text field describes in detail how the placeholders included in the error message work to create an error message. Although a default error message is suggested, users can edit the error message for the individual need.
Note: Although the error message can be edited by the user, editing the 'attribute_id' and 'attribute_value' placeholders results in 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 ID of the attribute that the metric is evaluating.
-
Open the 'Translations' section and click the 'Add translation' button (
).
-
Click the 'Language' selector dropdown and choose a language.
-
In the Message parameter, edit the text to reflect the language specified for translation.
-
Click the 'Add translation' button (
) to add another translation or click 'OK' to close the window.
-
Click 'Save' to close the Edit Metric Configuration wizard and save the metric.
Note: Translation error messages are displayed by using locales; they are not context-dependent. For more information about locales, refer to the topic Localization in the Administration Portal documentation. For more information about localized messages, refer to the topic Localized Messages for JavaScript Business Rules in the Business Rules documentation.
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 Referenced Target Object Metric (for this example, titled 'PrimaryImagesMetric') has been added to the sufficiency 'AssetInfoSufficiency,' and returned a score of '0' along with an error message that details the reason for the returned score.