Overview
The Compare Activity Counts enrichment analyzes whether two selected activities occur with equal frequency within each case, creating a boolean attribute that indicates balanced or imbalanced execution patterns. This enrichment is essential for validating process symmetry, ensuring paired operations are properly matched, and detecting deviations in expected activity patterns. Unlike simple counting enrichments that track individual activity occurrences, this operator specifically compares the execution counts of two activities to identify cases where they are balanced versus those where one activity occurs more frequently than the other.
This enrichment is particularly valuable in processes where certain activities should occur in pairs or with matching frequencies. For example, in procurement processes, you might expect each "Create Purchase Order" to have a corresponding "Receive Goods" activity. In manufacturing, quality checks might need to match production runs. In financial processes, debits and credits should balance. The enrichment helps identify cases where these expected patterns are violated, enabling targeted investigation of process deviations, incomplete executions, or system errors that cause imbalanced activity patterns.
Common Uses
- Validate that paired activities occur with equal frequency (order creation vs. order fulfillment)
- Ensure balanced operations in financial processes (payment initiated vs. payment completed)
- Check manufacturing process symmetry (assembly start vs. assembly complete activities)
- Verify quality control completeness (items produced vs. items inspected)
- Monitor approval workflows for consistency (approval requests vs. approval decisions)
- Detect incomplete process executions where expected matching activities are missing
- Identify system integration issues causing activity count mismatches
Settings
Filter (Optional): Apply filters to limit which cases are analyzed for activity count comparison. When filters are applied, only cases matching the filter criteria will have the comparison performed and the result stored. This is useful when you want to check activity balance only for specific subsets of your data, such as high-priority cases, specific product categories, or particular time periods. Cases not matching the filter will have a null value for the new attribute.
New Attribute Name: Specify the name for the new boolean attribute that will store the comparison result. Choose a descriptive name that clearly indicates what is being compared. For example, use "Orders_Balanced" when comparing order and delivery activities, or "QC_Complete" when comparing production and inspection activities. The attribute will contain "Yes" (true) when counts match, "No" (false) when they differ, or null when neither activity exists in the case.
Activity 1: Select the first activity to compare from the dropdown list of all activities in your dataset. This should be one of the paired activities you want to check for balance. The enrichment will count how many times this activity occurs in each case. The selection list shows all unique activities found in your event log, ensuring you can only select activities that actually exist in your data.
Activity 2: Select the second activity to compare from the dropdown list. This is the activity that should occur with the same frequency as Activity 1. The enrichment will count occurrences of this activity and compare them to Activity 1. You can select the same activity as Activity 1 if needed for special validation scenarios, though typically you would choose a different activity that forms a logical pair with Activity 1.
Examples
Example 1: Purchase Order and Goods Receipt Validation
Scenario: In a procurement process, you need to verify that every purchase order created has a corresponding goods receipt to ensure all ordered items have been delivered and process completion.
Settings:
- Filter: None (check all purchase orders)
- New Attribute Name: Order_Receipt_Balanced
- Activity 1: Create Purchase Order
- Activity 2: Record Goods Receipt
Output: Creates a new boolean case attribute "Order_Receipt_Balanced" with values:
- "Yes" - Cases where the number of purchase orders equals the number of goods receipts (e.g., 3 orders, 3 receipts)
- "No" - Cases where counts differ (e.g., 3 orders created but only 2 goods received)
- Null - Cases that contain neither activity (non-procurement cases in mixed datasets)
Insights: Cases showing "No" indicate incomplete procurement processes requiring investigation. This could reveal delayed deliveries, missing documentation, or system synchronization issues between ordering and receiving systems.
Example 2: Quality Check Completeness in Manufacturing
Scenario: In a manufacturing process, every production run should have a corresponding quality inspection to ensure product standards are met and compliance requirements are fulfilled.
Settings:
- Filter: Product_Category = "Electronics"
- New Attribute Name: QC_Inspection_Complete
- Activity 1: Complete Production Run
- Activity 2: Perform Quality Inspection
Output: Creates "QC_Inspection_Complete" attribute for electronic products:
- "Yes" - Production runs and quality inspections are balanced (e.g., 5 runs, 5 inspections)
- "No" - Mismatch in counts indicating missing inspections or duplicate production records
- Null - Cases without production activities (filtered non-electronics products show null)
Insights: This identifies production batches that bypassed quality control, enabling corrective action and compliance reporting. Patterns in mismatches might reveal specific production lines or shifts with systematic QC issues.
Example 3: Financial Transaction Reconciliation
Scenario: In an accounts payable process, you need to ensure that every payment approval has a corresponding payment execution to detect stuck or failed payment processes.
Settings:
- Filter: Amount > 10000 (focus on high-value transactions)
- New Attribute Name: Payment_Reconciled
- Activity 1: Approve Payment
- Activity 2: Execute Payment
Output: Creates "Payment_Reconciled" attribute for high-value transactions:
- "Yes" - Equal number of approvals and executions (properly completed payments)
- "No" - Imbalanced counts suggesting approved but unexecuted payments or execution errors
- Null - Cases without payment activities
Insights: Cases with "No" require immediate attention as they represent approved payments that haven't been executed, potentially causing vendor relationship issues or compliance violations.
Example 4: Customer Service Ticket Resolution
Scenario: In a customer service process, you want to verify that every ticket escalation to a specialist has received a specialist response, ensuring no escalated issues are abandoned.
Settings:
- Filter: Priority = "High" OR Priority = "Critical"
- New Attribute Name: Escalation_Handled
- Activity 1: Escalate to Specialist
- Activity 2: Specialist Response
Output: Creates "Escalation_Handled" attribute for high-priority tickets:
- "Yes" - All escalations received specialist responses (balanced support process)
- "No" - Some escalations lack responses (customer issues potentially unresolved)
- Null - High-priority tickets that were resolved without escalation
Insights: This metric helps identify service level breaches where escalated issues didn't receive appropriate specialist attention, enabling process improvement and staff training initiatives.
Example 5: Healthcare Appointment Management
Scenario: In a patient scheduling system, you need to ensure that every appointment scheduled has a corresponding appointment completion or cancellation record for accurate utilization reporting.
Settings:
- Filter: Department = "Radiology"
- New Attribute Name: Appointment_Closure_Complete
- Activity 1: Schedule Appointment
- Activity 2: Complete Appointment
Output: Creates "Appointment_Closure_Complete" attribute for radiology appointments:
- "Yes" - Scheduled and completed appointments are balanced
- "No" - Mismatch indicating no-shows, incomplete records, or scheduling errors
- Null - Non-appointment related radiology cases
Insights: Cases showing "No" help identify patterns in appointment no-shows, enabling targeted patient communication improvements and better resource planning for the radiology department.
Output
The Compare Activity Counts enrichment creates a single new boolean attribute at the case level containing the comparison result. The attribute uses the boolean data type with a "Yes/No" display format for easy interpretation in filters, pivot tables, and visualizations.
Value Logic:
- Yes (True): Both activities occur with exactly the same frequency in the case, including when both have zero occurrences
- No (False): The activities have different occurrence counts (one appears more frequently than the other)
- Null: Neither activity appears in the case, and the enrichment leaves the value empty rather than setting it to Yes
The new attribute can be immediately used in subsequent enrichments, filters, and calculations. Common applications include filtering to find only imbalanced cases, calculating the percentage of balanced processes, or using the attribute in conformance checking to identify process violations. The boolean nature of the output makes it ideal for KPI calculations, dashboard indicators, and automated alerting systems that need to flag process imbalances.
This documentation is part of the mindzie Studio process mining platform.