Skip to main content
The Attendance & Utilization Report provides daily analysis of agent performance metrics including shift completion, attendance tracking, and department-level utilization statistics. It processes Resource Inn data to identify performance issues, filter out management roles, and generate HTML email reports for operations teams.

Files & Location

  • ri-extended-daily-report.js — Core data processing script that parses raw Resource Inn data, calculates expected hours, floor time, shift completion percentages, and sets attendance flags (absent/on-time/late).
  • ri-attendance-report.js — Email report generator that applies performance filters, excludes management roles using keyword matching, and produces the final HTML report sent to stakeholders.
  • management-keywords.json — Configuration file containing list of keywords used to identify management roles that should be excluded from performance calculations.
  • code-to-department.json — Mapping configuration that converts department codes to human-readable department names used in filtering and reporting.
  • fetch-ri-extended-daily-report.js — Data fetcher that retrieves Resource Inn Excel/CSV reports and prepares them for processing (if present in your deployment).

Data sources

Raw attendance data comes from Resource Inn daily reports exported as Excel/CSV files. The fetch-ri-extended-daily-report.js script retrieves these files and passes them to ri-extended-daily-report.js for preprocessing. Pre-processing includes:
  • Time format normalization (converting various time formats to minutes)
  • Department code resolution using code-to-department.json
  • Expected hours calculation based on shift schedules
  • Break time extraction and validation

Field definitions

Calculations & formulas

Core performance metrics

Department-level calculations

Management filtering

Management roles are excluded from performance calculations using keyword matching:
  1. Keyword loading: ri-attendance-report.js loads keywords using:
  2. Matching behavior: Case-insensitive substring match against record.designation:
  3. Configuration: Add or modify keywords in management-keywords.json. Common entries include “Manager”, “Lead”, “Supervisor”, “Director”.

Edge cases & notes

  • Zero expected hours: Records with expectedHours of 0 or null are excluded from calculations to avoid division by zero and skewed averages.
  • Missing/malformed times: Invalid time formats are marked as absent and excluded from performance metrics. The parseTimeToMinutes function handles various formats but logs errors for unparseable values.
  • Designation ambiguity: Roles like “Lead” or “Team Lead” may be unintentionally excluded. Modify management-keywords.json to include or remove specific keywords based on your organizational structure.
  • Part-time shifts: Fractional expectedHours values are supported. The 75% threshold applies proportionally (e.g., 4-hour shift requires 3+ hours to pass).
  • Department name variations: Multiple department codes can map to the same name in code-to-department.json. Ensure all relevant codes are included for accurate filtering.
  • Time format variations: The parser handles formats like “06:00 pm”, “18:00”, “6:00 PM”. Unrecognized formats default to 0 and trigger absent flags.

Worked example

Input records

Calculations

Output summary

  • Department utilization: (75.0% + 68.75%) / 2 = 71.88%
  • Present count: 3 (all marked present)
  • Low performance: 1 agent (Bob)
  • Excessive breaks: 1 agent (Carol)
  • Management excluded: 1 record (Carol)

How to change thresholds & configuration

Low performance threshold

Edit ri-attendance-report.js and search for the 0.75 value or comment referencing “25% less”:

Break time limit

In the same file, find the break minutes comparison:

Include management in reports

To include management roles in calculations:
  1. Delete or rename management-keywords.json
  2. Or modify ri-attendance-report.js to skip the filtering step:

Testing suggestions

Unit tests to implement

Integration testing

Run the full processing pipeline in your project root:

References

  • Core processing: ri-extended-daily-report.js - parseTimeToMinutes(), calculateShiftCompletion(), getDepartmentNames()
  • Report generation: ri-attendance-report.js - isManagement(), generateHTMLReport()
  • Configuration files: management-keywords.json, code-to-department.json
  • Data fetching: fetch-ri-extended-daily-report.js (if deployed)
For detailed implementation, inspect the referenced functions and configuration files in your project repository.