Comparing Localized Values Scenario

Calculated attributes can be used to identify and then compare an inherited value with a localized value. For example, an attribute named 'Warranty' is valid both at the product family level and at the item level (child of the product family). An export include objects with a value entered at the item level that is different from the value entered at the product family level. In other words, only when the value is localized.

Assumptions

  1. Report only when the local value is different from the inherited value.
  2. Do not report if a value has been entered on the item that is the same as the inherited value.

Solution

Approach

The approach follows the steps below:

  1. A list of the product path is generated.
  2. The value for the Warranty attribute is calculated from the parent of the child product (item).
  3. The Warranty value for the child product is obtained.
  4. The Warranty value for the child product is compared to the Warranty value for the parent of the child product.
  5. If different, then both the inherited and local values are displayed.
  6. If same, then the results value is blank.

Value Template

{i:=path(),
parent:=listitem(i,listlen(i)-1),
parentvalue := iterate(parent, 'value("Warranty")'),
localvalue := value("Warranty")

}
if(exact(parentvalue,localvalue), "", concatenate("Parent Value = ", parentvalue, ", Local Value = ",localvalue))

Results

The value for the Warranty attribute on the parent node (Writing Pens) is 24.

The first child product has inherited the value for Warranty from the parent (indicated by the green triangle), so the calculated attribute result is blank.

The second child product has a localized value, but it is the same as the value on the parent (indicated by the green triangle), so the calculated attribute result is blank.

The third child product has a localized value that is different from the value on the parent, so the calculated attribute result shows both the parent and the local values.