Skip to content

v1.0.6 — Fix YTD cumulative quarterly values

Latest

Choose a tag to compare

@zoharbabin zoharbabin released this 19 Apr 01:23

Critical Fix

SEC XBRL 10-Q income statements and cash flow statements report year-to-date cumulative figures, not single-quarter values. The library was treating these as single-quarter values, causing TTM Revenue to be ~3x the correct result.

Example: KLTR TTM Revenue was $407M (wrong) → now $180M (correct, matching their ~$181M annual revenue).

Two-Part Fix

  • Single-filing path: When edgartools returns columns with (Q3) / (YTD) / (FY) suffixes, _convert_statement_df() now prefers single-quarter (Q*) columns over (YTD) cumulative columns and strips the suffixes.
  • Multi-period path: New decumulate_quarterly() detects YTD cumulative patterns in MultiFinancials stitched data and converts to single-quarter values: Q_n = YTD_n - YTD_{n-1} within each fiscal year. Applied to quarterly income/CF statements. Balance sheet data is never de-cumulated.

Also in this release

  • 18 new tests for column selection, suffix stripping, and de-cumulation logic
  • Updated docs/ARCHITECTURE.md with de-cumulation pipeline step
  • Updated docs/METRICS_REFERENCE.md TTM section

Full Changelog: v1.0.5...v1.0.6