DeltaValue
The DeltaValue function is supported both in Studio and in Search. It
returns the difference between two attribute values, according to the
following rules:
- If PreviousCase is not selected, the AttributeList must contain two
attributes names. The function will return the result of Attribute1
- Attribute2.
- If PreviousCase is selected, the AttributeList must contain only one attribute name. The function will return the result of Attribute(current case) - Attribute(previous case).
Prototype
DeltaValue(PreviousCase; Uom; Attributelist)
Arguments
PreviousCase String By value (Nullable)
Null (not defined) or empty string or equal to:
'N' -- work on current case
'Y' -- work on previous case
Uom String By value (Nullable)
Null (not defined) or empty -- no UOM conversion; a valid UOM.
AttributeList String By value (Nullable)
One or more valid strings, semi-colon separated, containing the attribute names to be totalized.
Depending on the model, different elements may have different attribute names. In such a case,
add all attribute names of interest in the totalization.
Returns
Number
The function returns the difference between the two values according to the calculation rule
(refer to function description).
Exception
Undefined
Undefined is returned if:
- PreviousCase is not empty and not a valid one, or the previous case does not exist
- Empty or invalid AttributeList
- Invalid UOM, if specified
Examples
DeltaValue( 'Y' ; ; 'MeasuredMass' )
This will return the delta value of the MeasuredMass attribute value using the previous case: MeasuredMass(current case) - MeasuredMass(previous case).
DeltaValue( ; 'MeasuredMass' ; 'ReconciledMass' )
The result will be MeasuredMass - ReconciledMass (current case).