Metric

What is accounts receivable aging?

Definition

Accounts receivable aging groups open customer invoice balances by how many days they are past due as of a specific date. Common buckets are current, 1-30, 31-60, 61-90, and more than 90 days overdue.

Formula: Days overdue = as-of date - invoice due date; aging amount = open invoice balance in each bucket

What data do you need?

  • Invoice issue and due dates
  • Invoice total, currency, and customer
  • Payment and credit allocations
  • Open balance as of the reporting date
  • Daily snapshots or lifecycle history for historical aging

SQL pattern

Open AR by aging bucketPostgreSQL
SELECT
  CASE
    WHEN {{as_of_date}} <= due_date THEN 'Current'
    WHEN {{as_of_date}} - due_date <= 30 THEN '1-30 days'
    WHEN {{as_of_date}} - due_date <= 60 THEN '31-60 days'
    WHEN {{as_of_date}} - due_date <= 90 THEN '61-90 days'
    ELSE '90+ days'
  END AS aging_bucket,
  SUM(open_amount_reporting_currency) AS open_amount
FROM modeled_open_ar
WHERE as_of_date = {{as_of_date}}
GROUP BY 1
ORDER BY MIN(GREATEST({{as_of_date}} - due_date, 0));

Common pitfalls

Aging today's open balance with an old as-of date.→ Use an as-of snapshot or reconstruct payment and credit allocation history.
Aging from invoice date instead of due date.→ Use the contractual due date unless the metric is explicitly invoice age.
Ignoring credits and unapplied cash.→ Model them explicitly so total AR reconciles to the ledger.

Where does this metric apply?

This metric commonly uses data from NetSuite, Xero, FreshBooks, QuickBooks, SAP, plus any reconciled warehouse or ledger models that provide the same business grain.

Dashboards

Integrations

Metrics

Analytics

FAQ

Should current invoices appear?
Yes. The current bucket shows open balances that are not yet overdue and keeps total AR reconcilable.
Should disputed invoices be excluded?
Keep booked balances in total AR, but split disputed exposure into a separate operational view.