Overview
The Subtract enrichment performs mathematical subtraction between two numeric attributes and stores the result in a new attribute. This is useful for calculating differences, variances, and deltas in your process data.
Common Uses
- Calculate the difference between quantities ordered and quantities received
- Determine the variance between planned and actual values (budget, time, resources)
- Calculate net changes by subtracting initial values from final values
- Compute deltas between expected and actual performance metrics
Settings
Start by going to the 'Log Enrichment' engine by going to any analysis and clicking 'Log Enrichment' in the top right.
Then click 'Add New'
Then choose the Subtract enrichment block.
Configuration Options
Filters: Add any filter you like. The enrichment will define attributes only for cases that are selected by the filter.
New Attribute Name: Specify the name of the new attribute you are about to create.
Column Name: Select the attribute that needs to be subtracted from (the minuend).
Minus Column Name: Select the attribute that represents the value that needs to be subtracted (the subtrahend).
Number of Decimals: Specify the number of decimal points to show in the new attribute.
Examples
Example 1: Calculate Quantity Difference
In a purchase order process, you may want to calculate the difference between quantity ordered and quantity received to identify discrepancies.
Scenario:
- Your event log contains attributes:
QuantityOrderedandQuantityReceived - You want to create a new attribute
QuantityDifferenceshowing the variance - The result should show 2 decimal places for precision
Configuration:
- New Attribute Name:
QuantityDifference - Column Name:
QuantityOrdered - Minus Column Name:
QuantityReceived - Number of Decimals: 2

Click 'Create' and once you're ready click 'Calculate Enrichment' to add the new attribute to your data set.
From the overview, you should now be able to find the newly created attribute:

Result: A positive value indicates more was ordered than received, while a negative value indicates more was received than ordered.

Output
When this enrichment is executed, it creates a new numeric case or event attribute with the name you specified in "New Attribute Name". The attribute value contains the result of subtracting the "Minus Column Name" value from the "Column Name" value.
The result is formatted to the number of decimal places you specified in "Number of Decimals".
Formula: Result = Column Name - Minus Column Name
Example: If Column Name = 100 and Minus Column Name = 25, the new attribute will contain 75.
Null Handling: Cases where either attribute is empty or null will not have a calculated value in the new attribute.
Data Type: Both attributes must contain numeric values. Non-numeric values will result in calculation errors.
See Also
Related Mathematical Enrichments:
- Add - Add two attribute values together
- Multiply - Multiply two attribute values
- Divide - Divide one attribute by another
Related Topics:
- Attribute Enrichments - Overview of attribute manipulation features
- Calculated Attributes - Create custom calculations using attributes
This documentation is part of the mindzieStudio process mining platform.