Overview
The Time To Previous Case In the Group enrichment calculates the time elapsed between consecutive cases within a specific group or category. By grouping cases based on a shared attribute (such as patient ID, resource name, machine ID, or department), this enrichment measures the interval from when one case started to when the next case in that same group started. This powerful temporal analysis capability enables organizations to understand workload patterns, identify bottlenecks in resource utilization, and measure throughput at a granular level.
This enrichment is particularly valuable for analyzing queue times, resource availability, and operational cadence. For example, in healthcare you can measure how long it takes between consecutive patient visits for the same doctor, in manufacturing you can track the time between production runs on the same machine, or in customer service you can analyze the interval between cases handled by the same agent. The enrichment automatically creates two new case attributes: the time duration to the previous case and the case ID of that previous case, providing both temporal and relational insights.
Unlike simple duration calculations that measure time within a single case, this enrichment looks across multiple cases to understand patterns in how work flows through your organization. It reveals whether resources are being fully utilized, whether there are excessive wait times between activities, and how workload distribution varies across different groups or categories in your process.
Common Uses
- Healthcare Resource Utilization: Measure time between consecutive patient appointments for the same physician to identify scheduling gaps and optimize clinic efficiency
- Manufacturing Machine Throughput: Calculate intervals between production runs on the same equipment to analyze machine utilization and identify idle time
- Customer Service Queue Analysis: Track time between cases handled by the same support agent to understand workload distribution and agent productivity
- IT Incident Management: Monitor the interval between tickets assigned to the same technician to balance workload and prevent overallocation
- Procurement Cycle Analysis: Measure time between purchase orders from the same supplier to optimize ordering frequency and maintain supplier relationships
- Banking Transaction Patterns: Analyze intervals between transactions for the same account or customer to detect unusual patterns or fraud indicators
- Warehouse Order Processing: Calculate time between picks from the same location to optimize warehouse layout and reduce travel time
Settings
Group By Attribute: Select the case attribute that defines your grouping category. Cases with the same value in this attribute will be grouped together for analysis. Common choices include resource names (e.g., "Doctor", "Machine", "Agent"), department identifiers, location codes, or any categorical attribute that represents a logical grouping of work. The enrichment will calculate the time from each case's start time to the start time of the previous case within the same group.
New Attribute Name: Specify the name for the new duration attribute that will be created. This attribute will contain the time span (in hours) between the current case's start time and the previous case's start time within the same group. Choose a descriptive name that reflects what you're measuring, such as "Time_Since_Last_Patient" or "Interval_Between_Orders". The enrichment will also automatically create a second attribute with "_CaseId" appended to your chosen name, which stores the case ID of the previous case in the group.
Filter Cases (Optional): Apply optional filters to limit which cases are included in the calculation. This is useful when you want to analyze only specific types of cases or exclude certain scenarios. For example, you might filter to include only completed cases, exclude cancelled orders, or focus on a specific time period. Cases that don't match the filter criteria will not be included in the grouping or time calculations.
Examples
Example 1: Patient Appointment Scheduling Analysis
Scenario: A healthcare clinic wants to optimize physician scheduling by understanding the actual time gaps between consecutive patient appointments. They need to identify whether doctors have excessive downtime between patients or if appointments are too tightly scheduled, leading to patient backlogs.
Settings:
- Group By Attribute: "Physician_Name"
- New Attribute Name: "Time_Since_Previous_Appointment"
- Filter Cases: None (analyze all appointments)
Output:
The enrichment creates two new case attributes:
- Time_Since_Previous_Appointment: Contains the duration in hours between the current appointment's start time and the previous patient's appointment start time for the same physician
- Time_Since_Previous_Appointment_CaseId: Contains the case ID of the previous patient appointment
Sample data showing the results:
| Case ID | Physician_Name | Appointment_Start | Time_Since_Previous_Appointment | Time_Since_Previous_Appointment_CaseId |
|---|---|---|---|---|
| PT-001 | Dr. Smith | 2024-01-15 08:00 | (null) | (null) |
| PT-002 | Dr. Smith | 2024-01-15 08:30 | 0.5 | PT-001 |
| PT-003 | Dr. Smith | 2024-01-15 09:15 | 0.75 | PT-002 |
| PT-004 | Dr. Jones | 2024-01-15 08:00 | (null) | (null) |
| PT-005 | Dr. Smith | 2024-01-15 11:00 | 1.75 | PT-003 |
Insights: The clinic can now identify patterns such as Dr. Smith having a 1.75-hour gap between PT-003 and PT-005, suggesting either a scheduled break or an inefficiency in appointment scheduling. By analyzing these intervals across all physicians, the clinic can optimize scheduling templates to reduce wait times while ensuring physicians have adequate time per patient.
Example 2: Manufacturing Machine Utilization
Scenario: A manufacturing plant needs to measure equipment utilization by analyzing the time between consecutive production runs on each machine. This helps identify underutilized assets and optimize production scheduling to maximize throughput.
Settings:
- Group By Attribute: "Machine_ID"
- New Attribute Name: "Machine_Idle_Time"
- Filter Cases: Production_Status = "Completed" (exclude cancelled or failed runs)
Output:
The enrichment creates:
- Machine_Idle_Time: Duration in hours between the current production run start and the previous run start on the same machine
- Machine_Idle_Time_CaseId: Case ID of the previous production run
Sample data:
| Case ID | Machine_ID | Run_Start_Time | Product_Type | Machine_Idle_Time | Machine_Idle_Time_CaseId |
|---|---|---|---|---|---|
| RUN-101 | MCH-A01 | 2024-01-15 06:00 | Widget-X | (null) | (null) |
| RUN-102 | MCH-A01 | 2024-01-15 08:30 | Widget-Y | 2.5 | RUN-101 |
| RUN-103 | MCH-A02 | 2024-01-15 06:00 | Widget-Z | (null) | (null) |
| RUN-104 | MCH-A01 | 2024-01-15 12:00 | Widget-X | 3.5 | RUN-102 |
| RUN-105 | MCH-A02 | 2024-01-15 14:00 | Widget-Y | 8.0 | RUN-103 |
Insights: Machine MCH-A02 shows an 8-hour gap between runs, suggesting significant underutilization or potential maintenance issues. MCH-A01 has more consistent utilization with 2.5 to 3.5 hour intervals. Plant managers can use this data to balance production schedules, identify opportunities for additional capacity, or investigate why certain machines have excessive idle time.
Example 3: Customer Service Agent Workload Analysis
Scenario: A customer service center wants to analyze workload distribution across support agents by measuring the time between consecutive cases assigned to each agent. This helps identify whether some agents are overloaded while others have capacity, enabling better case routing decisions.
Settings:
- Group By Attribute: "Assigned_Agent"
- New Attribute Name: "Time_Between_Cases"
- Filter Cases: Case_Type = "Support Ticket" (exclude internal tasks)
Output:
The enrichment creates:
- Time_Between_Cases: Hours between when consecutive cases were assigned to the same agent
- Time_Between_Cases_CaseId: Previous case ID for the same agent
Sample data:
| Case ID | Assigned_Agent | Case_Start_Time | Priority | Time_Between_Cases | Time_Between_Cases_CaseId |
|---|---|---|---|---|---|
| TKT-501 | Agent_Sarah | 2024-01-15 09:00 | High | (null) | (null) |
| TKT-502 | Agent_Mike | 2024-01-15 09:05 | Medium | (null) | (null) |
| TKT-503 | Agent_Sarah | 2024-01-15 09:15 | Low | 0.25 | TKT-501 |
| TKT-504 | Agent_Sarah | 2024-01-15 09:30 | High | 0.25 | TKT-503 |
| TKT-505 | Agent_Mike | 2024-01-15 11:00 | Medium | 1.92 | TKT-502 |
Insights: Agent Sarah is receiving new cases every 15 minutes (0.25 hours), indicating high workload, while Agent Mike has nearly 2 hours between cases, suggesting available capacity. The service center can use this information to rebalance case assignments, ensuring fair workload distribution and optimal response times for customers.
Example 4: Supplier Order Frequency Analysis
Scenario: A procurement department wants to analyze ordering patterns with suppliers to optimize inventory management and supplier relationships. By measuring the time between consecutive purchase orders to the same supplier, they can identify opportunities to consolidate orders or maintain optimal ordering frequencies.
Settings:
- Group By Attribute: "Supplier_Name"
- New Attribute Name: "Days_Since_Last_Order"
- Filter Cases: Order_Status = "Approved" (exclude rejected or pending orders)
Output:
The enrichment creates:
- Days_Since_Last_Order: Time in hours between purchase orders to the same supplier (can be converted to days by dividing by 24)
- Days_Since_Last_Order_CaseId: Previous purchase order case ID
Sample data:
| Case ID | Supplier_Name | Order_Date | Total_Amount | Days_Since_Last_Order | Days_Since_Last_Order_CaseId |
|---|---|---|---|---|---|
| PO-1001 | Acme Corp | 2024-01-05 | $5,000 | (null) | (null) |
| PO-1002 | Beta Supply | 2024-01-08 | $12,000 | (null) | (null) |
| PO-1003 | Acme Corp | 2024-01-12 | $3,200 | 168.0 | PO-1001 |
| PO-1004 | Acme Corp | 2024-01-15 | $4,500 | 72.0 | PO-1003 |
| PO-1005 | Beta Supply | 2024-01-25 | $15,000 | 408.0 | PO-1002 |
Insights: The company is ordering from Acme Corp every 3-7 days (72-168 hours), suggesting frequent small orders that might benefit from consolidation to reduce shipping costs. Beta Supply shows 17-day intervals (408 hours), which might be optimal for bulk ordering. Procurement can use this analysis to negotiate volume discounts, optimize ordering frequencies, and maintain healthy supplier relationships.
Example 5: IT Incident Resolution Queue Management
Scenario: An IT department needs to analyze how incidents are distributed across technicians to ensure balanced workloads and prevent technician burnout. By measuring time between consecutive incident assignments, they can identify workload imbalances and optimize ticket routing.
Settings:
- Group By Attribute: "Assigned_Technician"
- New Attribute Name: "Incident_Assignment_Interval"
- Filter Cases: Incident_Type != "Informational" (exclude non-actionable tickets)
Output:
The enrichment creates:
- Incident_Assignment_Interval: Hours between consecutive incident assignments to the same technician
- Incident_Assignment_Interval_CaseId: Previous incident case ID
Sample data:
| Case ID | Assigned_Technician | Assignment_Time | Severity | Incident_Assignment_Interval | Incident_Assignment_Interval_CaseId |
|---|---|---|---|---|---|
| INC-201 | Tech_Alex | 2024-01-15 08:00 | Critical | (null) | (null) |
| INC-202 | Tech_Alex | 2024-01-15 08:45 | High | 0.75 | INC-201 |
| INC-203 | Tech_Jordan | 2024-01-15 09:00 | Medium | (null) | (null) |
| INC-204 | Tech_Alex | 2024-01-15 09:30 | Critical | 0.75 | INC-202 |
| INC-205 | Tech_Jordan | 2024-01-15 14:00 | Low | 5.0 | INC-203 |
Insights: Tech Alex is receiving critical and high-severity incidents every 45 minutes (0.75 hours), indicating potential overload, while Tech Jordan has 5 hours between assignments. The IT manager can use this data to rebalance incident routing, ensure critical incidents get prompt attention without overwhelming individual technicians, and maintain service quality across the team.
Output
When this enrichment is executed, it creates two new case attributes for comprehensive temporal and relational analysis:
Primary Duration Attribute ([Your Specified Name]):
- Data Type: TimeSpan (displayed as decimal hours)
- Units: Duration in hours
- Value: The time elapsed from the previous case's start time to the current case's start time within the same group
- First Case in Group: Null value (no previous case exists in the group)
- Calculation Method: Current case start time minus previous case start time, ordered chronologically within each group
Secondary Case ID Attribute ([Your Specified Name]_CaseId):
- Data Type: String (text)
- Value: The case ID of the previous case in the same group
- First Case in Group: Null value (no previous case exists)
- Purpose: Enables tracing back to the specific previous case for detailed analysis or validation
Understanding the Output Values:
Example duration values and their meanings:
0.25= 15 minutes since the previous case in this group2.5= 2 hours and 30 minutes since the previous case24.0= Exactly one day (24 hours) since the previous case168.0= One week (7 days) since the previous casenull= This is the first case in the group, or the case doesn't belong to any group (if the grouping attribute is null)
Important Grouping Behavior:
- Cases are grouped based on exact matches of the "Group By Attribute" value
- Within each group, cases are ordered by their start time (earliest to latest)
- Each case is compared only to the immediately previous case in the same group
- Cases with null or blank values in the grouping attribute are not included in any group calculations
- If a filter is applied, only cases matching the filter are considered when determining the "previous" case
Using the Output Attributes:
The new attributes can be leveraged across mindzieStudio for powerful analysis:
- Performance Dashboards: Create visualizations showing average time between cases by group, identifying which resources have optimal utilization versus excessive idle time
- Case Filtering: Filter to cases where the interval is too short (potential overload) or too long (underutilization), enabling targeted process improvements
- Statistical Analysis: Calculate statistics like mean, median, and standard deviation of intervals to understand variability in workload distribution
- Variant Analysis: Compare process variants based on resource utilization patterns and identify best practices
- Bottleneck Detection: Identify groups (resources, departments, locations) with consistently long intervals, suggesting capacity constraints or inefficiencies
- Trend Analysis: Track how intervals change over time to measure the impact of process improvements or workload changes
- Relational Analysis: Use the _CaseId attribute to create relationships between consecutive cases, enabling deeper investigation of patterns or anomalies
Integration with Other Enrichments:
This enrichment works particularly well when combined with:
- Categorize Attribute Values: Group intervals into categories like "Normal", "Delayed", "Rushed"
- Duration Between Two Activities: Compare inter-case intervals with intra-case durations for comprehensive cycle time analysis
- Count Activities: Correlate case complexity (activity count) with inter-case intervals to understand resource capacity
- Representative Case Attribute: Pull attributes from the previous case using the _CaseId to compare consecutive case characteristics
See Also
Related Time Analysis Enrichments:
- Duration Between Two Activities - Calculate time elapsed between activities within a single case
- Duration Between an Attribute and an Activity - Measure duration from a case attribute timestamp to an activity
- Duration Between an Attribute and Current Time - Calculate time from a case attribute to the current date
Related Grouping and Analysis:
- Categorize Attribute Values - Group attribute values into categories for analysis
- Representative Case Attribute - Extract representative values from grouped cases
- Count Activities - Count activities per case for complexity analysis
Process Analysis Tools:
- Filter Process Log - Filter cases based on criteria including the new interval attributes
- Performance Analysis - Use interval data in performance dashboards and metrics
This documentation is part of the mindzie Studio process mining platform.