Item Rule Production Value Functions

Use item rule production value functions and operators to compare the new value of an attribute to the value that is currently in production. This can be especially useful in tolerance rules.

changed

Syntax:

changed(attribute)
changed(attributeGroup)

Returns TRUE if the current value of attribute or attributeGroup differs from the current production value. Returns FALSE otherwise. Works with null values. If only attributeGroup is specified, then returns TRUE if any attribute in that attribute group has changed.

delta

Syntax:

delta(attribute)

Returns the difference between new and current production values of attribute. Comparisons of String values are case-insensitive. In comparisons of Boolean values, TRUE is considered greater than FALSE.

The following table illustrates the return value of this function when comparing new and current production values of various combinations of Numeric, Date, and DateTime attribute types.

Value comparison

Returned result for Numeric values

Returned result for Date or DateTime values

new < current production

new minus current production

new minus current production

new > current production

new minus current production

new minus current production

new == current production

0

0

current production does not exist

null

null

both new and current production are null

0

0

either new or current production are null, but not both

null

null

percent

Syntax:

percent(attribute)

Returns the difference between new and current production values, expressed as a percentage, according to the following formula:

(delta(attribute) / current_production_value ) * 100

Where attribute is the argument passed to percent(), and current_production_value is the current production value of the attribute. Can only be used with Numeric attributes.

previous

Syntax:

previous(attribute)

Returns the previous production value of attribute.