{"slug":"the-quarter-end-that-didnt-file","qid":"sparse_month_ends","label":"Every weekday month-end since 2020 with fewer than 1,000 filings: count, companies touched, and the neighbouring days' average","post_title":"SEC EDGAR Index Gap: the Missing Month-Ends","post_url":"/blog/the-quarter-end-that-didnt-file#q-sparse_month_ends","columns":["month_end","filings","companies","neighbour_day_avg","pct_of_normal","last_row_arrived"],"rows":[{"month_end":"2021-05-31","filings":0,"companies":0,"neighbour_day_avg":3302,"pct_of_normal":0,"last_row_arrived":"1970-01-01"},{"month_end":"2021-12-31","filings":1,"companies":1,"neighbour_day_avg":3299,"pct_of_normal":0,"last_row_arrived":"2026-03-16"},{"month_end":"2025-04-30","filings":928,"companies":500,"neighbour_day_avg":4867,"pct_of_normal":19.1,"last_row_arrived":"2026-03-16"},{"month_end":"2026-03-31","filings":55,"companies":47,"neighbour_day_avg":4631,"pct_of_normal":1.2,"last_row_arrived":"2026-04-02"},{"month_end":"2026-04-30","filings":34,"companies":29,"neighbour_day_avg":5309,"pct_of_normal":0.6,"last_row_arrived":"2026-05-02"},{"month_end":"2026-06-30","filings":31,"companies":27,"neighbour_day_avg":4444,"pct_of_normal":0.7,"last_row_arrived":"2026-07-02"}],"shape":"table","sql":"WITH daily AS (\n    SELECT\n        filing_date,\n        uniqExact(accession_number) AS filings,\n        uniqExact(cik) AS companies,\n        max(_ingest_time) AS last_arrived\n    FROM global_markets.stocks_sec_edgar_index\n    WHERE filing_date >= toDate('2019-12-20') AND filing_date <= toDate('2026-07-06')\n    GROUP BY filing_date\n),\nmonth_ends AS (\n    SELECT arrayJoin(arrayMap(i -> toLastDayOfMonth(addMonths(toDate('2020-01-01'), i)), range(78))) AS me\n),\nsparse AS (\n    SELECT\n        e.me AS me,\n        toUInt32(ifNull(d.filings, 0)) AS filings,\n        toUInt32(ifNull(d.companies, 0)) AS companies,\n        d.last_arrived AS last_arrived\n    FROM month_ends AS e\n    LEFT JOIN daily AS d ON d.filing_date = e.me\n    WHERE toDayOfWeek(e.me) <= 5 AND toUInt32(ifNull(d.filings, 0)) < 1000\n)\nSELECT\n    toString(s.me) AS month_end,\n    any(s.filings) AS filings,\n    any(s.companies) AS companies,\n    toUInt32(round(avgIf(n.filings, abs(dateDiff('day', n.filing_date, s.me)) <= 5 AND n.filing_date != s.me))) AS neighbour_day_avg,\n    round(100 * any(s.filings) / avgIf(n.filings, abs(dateDiff('day', n.filing_date, s.me)) <= 5 AND n.filing_date != s.me), 1) AS pct_of_normal,\n    toString(toDate(any(s.last_arrived))) AS last_row_arrived\nFROM sparse AS s\nCROSS JOIN daily AS n\nGROUP BY s.me\nORDER BY s.me","computed_at":"2026-07-26T06:16:23.729783+00:00","elapsed":4.736875005}