Skip to main content

sdac-compare-quarters

Purpose

Calculates salary, fringe, and personnel-count differentials between the current quarter and the prior-year quarter.

Tool type

Deterministic (rule-based)

Tool ID

sdac-compare-quarters

Inputs

  • report_id (string)
  • threshold_pct (number, optional, default: 5)

Outputs

  • Current vs. prior totals
  • Differential values and percentage deltas
  • flagged indicators when deltas exceed threshold

Example output

{
"success": true,
"current_report_id": "SDAC-2024-Q2-001",
"comparison_report_id": "SDAC-2023-Q2-001",
"salary": {
"current": 1250000,
"comparison": 1153000,
"delta": 97000,
"percent_delta": 8.41,
"flagged": true
},
"fringe": {
"current": 312000,
"comparison": 283000,
"delta": 29000,
"percent_delta": 10.25,
"flagged": true
},
"position_count": {
"current": 84,
"comparison": 79,
"delta": 5,
"percent_delta": 6.33,
"flagged": true
}
}

Functional details

  • Compares totals and percent deltas against threshold_pct.
  • Optionally includes personnel change analysis and cost pool breakdowns.
  • Produces actionable recommendations when trends exceed thresholds.

Implementation details

  • Uses loadReportMetadata, loadReportTotals, and loadPriorYearReport.
  • Percent deltas are null when prior totals are 0.
  • Flags when abs(percent) > threshold_pct.
  • Formats a comparison_summary string for display use.

Code Location: packages/domain-sdac/src/tools/compare-quarters.tool.ts