Duration Between An Attribute And Current Time

Overview

The Duration Between an Attribute and Current Time enrichment calculates the elapsed time between a timestamp attribute in your process data and the current moment when the analysis is run. This powerful operator enables real-time monitoring and aging analysis by automatically computing how much time has passed since a specific event or milestone occurred in each case. Whether you're tracking invoice due dates, measuring how long orders have been pending, or monitoring SLA compliance in real-time, this enrichment provides critical time-based metrics that help identify bottlenecks, overdue items, and time-sensitive process issues.

This enrichment is particularly valuable for creating dashboards and reports that need to show current status and aging information. Unlike static duration calculations between two fixed points in time, this operator dynamically updates its calculations based on when the analysis is performed, making it ideal for operational monitoring, compliance tracking, and proactive process management. The flexible output options allow you to express durations in various units (days, hours, minutes, etc.) and formats (whole numbers or fractional values), ensuring the results align with your specific business requirements and reporting standards.

Common Uses

  • Monitor how many days invoices have been outstanding since their due date for accounts receivable management
  • Track the age of open support tickets or customer service requests to ensure timely resolution
  • Calculate how long purchase orders have been pending approval to identify procurement bottlenecks
  • Measure time elapsed since patient admission in healthcare facilities for length-of-stay monitoring
  • Determine how many days inventory items have been in stock for warehouse management and aging analysis
  • Track the duration since contract expiration dates for renewal management and compliance
  • Monitor how long equipment has been out for maintenance to optimize asset utilization

Settings

New Attribute Name: The name of the new case attribute that will store the calculated duration. This should be descriptive and indicate what time period is being measured. For example, if calculating days since invoice due date, you might name it "DaysPastDue" or "InvoiceAgeDays". The attribute name should follow your organization's naming conventions and be easily understood by report users. Avoid using spaces or special characters that might cause issues in subsequent analysis.

Attribute Name: Select the existing timestamp attribute from which to calculate the duration. This dropdown displays all DateTime attributes available in your dataset. The attribute you choose represents the starting point for the duration calculation. Common examples include "DueDate", "OrderDate", "AdmissionDate", "ContractStartDate", or any other timestamp field in your data. Ensure the selected attribute contains valid date/time values for accurate calculations.

Duration Type: Specifies the unit of measurement for the calculated duration. Available options include:

  • Days: Standard for business aging and due date calculations (default)
  • Hours: Useful for shorter process cycles or SLA monitoring
  • Minutes: For detailed operational tracking
  • Seconds: High-precision timing requirements
  • Weeks: Longer-term trend analysis
  • Months: Financial and contract period calculations
  • Years: Long-term lifecycle analysis
  • TimeSpan: Returns a formatted duration string (e.g., "5d 3h 45m") Choose the unit that best matches your business reporting needs and makes the output most intuitive for users.

Attribute Value As Last Time: This checkbox reverses the direction of the calculation. When unchecked (default), the calculation is: Current Time - Attribute Value, which gives positive values for past dates. When checked, the calculation becomes: Attribute Value - Current Time, which gives positive values for future dates. Use the default (unchecked) for aging calculations where you want to know how much time has passed. Check this option when calculating time remaining until a future event, such as days until contract expiration or time until scheduled maintenance.

Allow Fractional Periods: Controls whether the output includes decimal values or rounds to whole numbers. When unchecked (default), durations are returned as integers (e.g., "5 days"). When checked, durations include fractional parts (e.g., "5.75 days"). Enable this for more precise calculations, especially when using larger time units like days or weeks where partial periods are meaningful. Financial calculations often require fractional periods for accurate interest or penalty calculations.

Examples

Example 1: Invoice Aging for Accounts Receivable

Scenario: A finance team needs to monitor outstanding invoices and identify those that are overdue by calculating the number of days past the invoice due date.

Settings:

  • New Attribute Name: DaysPastDue
  • Attribute Name: InvoiceDueDate
  • Duration Type: Days
  • Attribute Value As Last Time: Unchecked
  • Allow Fractional Periods: Unchecked

Output: The enrichment creates a new case attribute "DaysPastDue" with integer values representing the number of complete days since each invoice's due date. For example:

  • Invoice #1001 with due date 2024-01-15: 45 days past due
  • Invoice #1002 with due date 2024-02-01: 28 days past due
  • Invoice #1003 with due date 2024-02-20: 9 days past due
  • Invoice #1004 with future due date: 0 or negative value (not yet due)

Insights: The finance team can now easily filter for invoices past due by more than 30 days for collection efforts, create aging buckets (0-30, 31-60, 61-90, 90+ days), and calculate average days sales outstanding (DSO) metrics.

Example 2: Patient Length of Stay Monitoring

Scenario: A hospital administrator needs to track how long patients have been admitted to optimize bed utilization and identify potential discharge delays in real-time.

Settings:

  • New Attribute Name: CurrentLengthOfStayHours
  • Attribute Name: AdmissionDateTime
  • Duration Type: Hours
  • Attribute Value As Last Time: Unchecked
  • Allow Fractional Periods: Checked

Output: The enrichment generates "CurrentLengthOfStayHours" showing precise duration since admission:

  • Patient A admitted 3 days ago: 72.5 hours
  • Patient B admitted yesterday morning: 31.25 hours
  • Patient C admitted 6 hours ago: 6.0 hours
  • Patient D admitted 2 weeks ago: 336.75 hours

Insights: Hospital staff can identify patients with extended stays requiring case management review, monitor average length of stay trends in real-time, and proactively manage bed capacity by predicting discharge patterns.

Example 3: Purchase Order Approval Delays

Scenario: A procurement team wants to identify purchase orders that have been waiting for approval to expedite processing and prevent supplier relationship issues.

Settings:

  • New Attribute Name: DaysAwaitingApproval
  • Attribute Name: SubmissionDate
  • Duration Type: Days
  • Attribute Value As Last Time: Unchecked
  • Allow Fractional Periods: Checked

Output: Creates "DaysAwaitingApproval" attribute with fractional day values:

  • PO-2024-001 submitted last week: 7.5 days
  • PO-2024-002 submitted yesterday: 1.25 days
  • PO-2024-003 submitted this morning: 0.33 days
  • PO-2024-004 submitted 3 weeks ago: 21.75 days

Insights: The procurement team can prioritize orders waiting longest for approval, identify approval bottlenecks by analyzing patterns in delayed orders, and set up alerts for orders exceeding acceptable waiting periods.

Example 4: Equipment Maintenance Duration Tracking

Scenario: A manufacturing plant needs to monitor how long equipment has been out for maintenance to minimize production downtime and optimize maintenance scheduling.

Settings:

  • New Attribute Name: MaintenanceTimeSpan
  • Attribute Name: MaintenanceStartTime
  • Duration Type: TimeSpan
  • Attribute Value As Last Time: Unchecked
  • Allow Fractional Periods: Not applicable for TimeSpan

Output: Generates "MaintenanceTimeSpan" with formatted duration strings:

  • Machine A: "2d 4h 30m" (2 days, 4 hours, 30 minutes in maintenance)
  • Machine B: "0d 8h 15m" (8 hours, 15 minutes in maintenance)
  • Machine C: "5d 12h 45m" (5 days, 12 hours, 45 minutes in maintenance)
  • Machine D: "0d 2h 10m" (2 hours, 10 minutes in maintenance)

Insights: Operations managers can quickly identify equipment with extended maintenance times, calculate actual vs. planned maintenance durations, and optimize maintenance windows to minimize production impact.

Example 5: Contract Renewal Countdown

Scenario: A sales team needs to track time remaining until customer contracts expire to proactively manage renewals and prevent service interruptions.

Settings:

  • New Attribute Name: DaysUntilExpiration
  • Attribute Name: ContractEndDate
  • Duration Type: Days
  • Attribute Value As Last Time: Checked
  • Allow Fractional Periods: Unchecked

Output: Creates "DaysUntilExpiration" showing whole days until contract expiration:

  • Customer A contract expires in 2 months: 60 days
  • Customer B contract expires next week: 7 days
  • Customer C contract expires tomorrow: 1 day
  • Customer D contract already expired: -5 days (negative indicates expired)

Insights: The sales team can create renewal campaigns targeting contracts expiring within 30-60 days, prioritize urgent renewals for contracts expiring within a week, and identify already-expired contracts requiring immediate attention.

Output

The Duration Between an Attribute and Current Time enrichment creates a single new case attribute in your dataset containing the calculated time duration for each case. The data type and format of this attribute depend on your selected Duration Type setting. When Duration Type is set to Days, Hours, Minutes, Seconds, Weeks, Months, or Years, the enrichment creates either an integer attribute (when Allow Fractional Periods is unchecked) or a decimal attribute (when checked). Integer values provide whole number durations suitable for high-level reporting, while decimal values offer precise measurements for detailed analysis. When Duration Type is set to TimeSpan, the enrichment creates a TimeSpan attribute displaying formatted duration strings like "3d 14h 22m" that are human-readable and ideal for operational dashboards.

The output attribute automatically handles null values in the source timestamp attribute by producing null results, ensuring data integrity is maintained throughout your analysis. Negative values in the output indicate reverse time relationships - when Attribute Value As Last Time is unchecked, negative values mean the timestamp is in the future; when checked, negative values indicate the timestamp is in the past. This bidirectional capability makes the enrichment suitable for both aging analysis and countdown scenarios.

The calculated duration values can be immediately used in subsequent enrichments, filters, and calculators. Common applications include creating categorical buckets (e.g., "0-30 days", "31-60 days"), setting threshold-based alerts, calculating statistical measures like average age or maximum duration, and building KPIs for process performance monitoring. The attribute integrates seamlessly with mindzie's visualization components, allowing you to create charts, gauges, and tables that dynamically update based on when the analysis is refreshed.


This documentation is part of the mindzie Studio process mining platform.

An error has occurred. This application may no longer respond until reloaded. Reload ??