Attendance data lineage and field mapping
Updated 7 November 2026 against validated development release 20261107T004657842984Z-549a75f2, built from code b663171. The selected local release contains 400 observations across 100 relegation events. Silver has 14 columns and gold has 44. Two attendance decisions remain pending. The latest known measurement season is 2025-26, with three empty 2026-27 placeholders.
Open the standalone diagram. The Mermaid source is data-lineage.mmd in the maintained project.
End-to-end flow
flowchart TD
W[Manually compiled attendance workbook] --> SNAP[Input and code snapshots]
H[Historical standings and selected patch] --> SNAP
D[Manual attendance decisions] --> SNAP
A[Reviewed club aliases and chronology rules] --> SNAP
WEB[Wikipedia season pages] --> SCRAPE[Separate stadium acquisition]
SCRAPE --> STAD[Saved stadium dimension]
STAD --> SNAP
LOOK[Capacity gap-fill and club-city lookups] --> SNAP
SNAP -->|Workbook, standings, decisions| SIL[Silver validation and event panel]
SIL --> S[Silver CSV and Parquet plus audits]
SNAP -->|Stadium and location inputs| GOLD[Gold enrichment and calculations]
S --> GOLD
GOLD --> G[Gold CSV and Parquet plus audits]
S --> CHECK[Complete-release validation]
G --> CHECK
CHECK --> M[Hashed manifest and retained release]
M --> P[Atomic current-release pointer]
P --> PY[Python consumer pins one release]
G -. Verified logical equality .-> SITE[Website snapshot with recorded hashes]
SITE --> ARTICLE[Article analysis]
P -. Rebinding pending .-> PBI[Power BI Desktop]
PBI -. Publication pending .-> EMBED[Embedded online report]
REVIEW[Manual capacity review pending] -. Future override decisions .-> LOOK
The release runner executes the silver and gold stages against its frozen input and code copies. Stadium acquisition is a separate operation. A saved stadium dimension is an input to gold. Article computation uses a website snapshot whose exact file hashes are recorded separately from the local pipeline files. Power BI rebinding and service publication are pending.
Relational schema and stage inventories provide keys, cardinalities, types and nullability for the tables below.
Maintained inputs and joins
| Input or rule | Grain or key | Consumer | Decision or validation |
|---|---|---|---|
| Relegation Attendance Churn_copy.xlsx | One row per relegation event | Silver | Explicit four season/attendance pairs. Known summary/header/template exclusions are audited. |
| standings.csv and optional standings24_25.csv | Team and Season | Silver | Normalize season keys, reject duplicate keys and join many-to-one. The patch is a selected supplement. |
| Reviewed aliases in attendance_validation.py | Source club label | Silver | Exact normalized identities and explicit aliases apply. Fuzzy suggestions require review. |
| attendance_reconciliation.csv | Team and Season | Silver | Pending, provisional or validated manual decisions. Applied choices affect every overlapping event window. |
| gold_dim_stadiums_pyramid.csv | Team, Season and Tier | Gold | Saved output from the separate scraper. The most populated stadium/capacity record is preferred when repeated source keys exist. |
| stadium_capacity_lookup_template.csv | Team, Season and Tier | Gold | Independent gap fills. Correcting a populated disputed capacity requires separate override support. |
| club_city_lookup.csv | Team | Gold | Required club-home locality. |
| pyproject.toml, uv.lock and executed scripts | Exact file bytes | Runner | Code/input snapshots and environment identities are recorded in the manifest. |
Field-level mapping
The following table covers every exported gold field. The first 14 fields also form the silver schema.
| Field | Introduced | Immediate source | Rule and missingness |
|---|---|---|---|
Observation_ID |
Silver | Event identifier and relative year | Relegation_Event_ID plus underscore plus Year_vs_Relegation. Unique and populated. |
Relegation_Event_ID |
Silver | Clean Team and source event Season | One event key repeated over four rows. Existing source season spelling is retained. |
Team |
Silver | Workbook Relegated Team and standings team_name | Whitespace/case normalization and reviewed aliases. Unresolved identities fail with suggestions. |
Season |
Silver | Four workbook season columns | Year Before, Season, Year After and 2 years after map to offsets -1, 0, +1, +2. Consecutive years and offsets are checked. |
Tier |
Silver | Standings tier | Join on normalized Team and Season with a many-to-one contract. Future measurements are missing. |
Position |
Silver | Standings position | Join on Team and Season. Future measurements are missing. |
Attendance |
Silver | Four workbook attendance columns and attendance_reconciliation.csv | Year Before Att, Attendance, Attendance year after and Attendance 2 years after. Provisional/validated club-season decisions override all matching windows. Pending decisions preserve source values. |
Year_vs_Relegation |
Silver | Explicit workbook slices | The four exported offsets are -1, 0, +1 and +2. |
Year_End_Outcome |
Silver | Current and next-season standings tiers | Y+1/Y+2 use the next-tier transition. Temporary Y+3 supplies the final transition. Y0 is Relegated. Y-1 uses its current-tier convention. Unknown transitions stay missing. |
Games_Played_History |
Silver | Standings played | Season total joined on Team and Season. |
Wins_History |
Silver | Standings wins | Season total joined on Team and Season. |
Goals_For_History |
Silver | Standings goals_for | Season total joined on Team and Season. |
Goals_Against_History |
Silver | Standings goals_against | Season total joined on Team and Season. |
Points_History |
Silver | Standings points | Supplied season total, including any source adjustments. |
Club_City |
Gold | club_city_lookup.csv | Required many-to-one Team lookup for the club home locality. |
Stadium |
Gold | Saved stadium dimension and capacity gap-fill lookup | Join Team, Season, Tier. The lookup fills blank Stadium independently of Capacity. |
Capacity |
Gold | Saved stadium dimension and capacity gap-fill lookup | Join Team, Season, Tier. The lookup fills blank Capacity. Disputed populated capacities require manual review and future override support. |
City |
Gold | Saved stadium dimension | Season-specific stadium locality. It may have an explicit donor record. |
GeoPlace |
Gold | Club_City | Club_City plus United Kingdom. This panel uses club-home geography. |
SourceURL |
Gold | Saved dimension and applied gap-fill lookup | General row source. Field-specific URLs provide more precise attribution where available. |
City_Imputed |
Gold | Saved dimension scraper | Flag for a city supplied from agreeing directly observed stadium-name donors. |
City_SourceURL |
Gold | Saved dimension scraper | Supporting city donor URL when retained. |
City_Donor_Season |
Gold | Saved dimension scraper | Season of the supporting city donor. |
Stadium_Lookup_Applied |
Gold | Capacity gap-fill lookup | True where the lookup filled a blank stadium. |
Capacity_Lookup_Applied |
Gold | Capacity gap-fill lookup | True where the lookup filled a blank capacity. |
Stadium_Capacity_Lookup_Notes |
Gold | Capacity gap-fill lookup Notes | Notes retained for an applied stadium or capacity fill. |
Stadium_SourceURL |
Gold | Saved dimension or applied gap-fill lookup | Provenance for the stadium field. |
Capacity_SourceURL |
Gold | Saved dimension or applied gap-fill lookup | Provenance for the capacity field. Evidence can still require historical review. |
Is_Covid_Affected |
Gold | Season | True exactly for Season 2020-21. |
Event_Season |
Gold | Event Y0 Season | Normalized event season repeated across its rows. |
Baseline_Attendance |
Gold | Y0 Attendance or eligible Y-1 Attendance | Default Y0. For 2020-21 events, Y-1 can be selected when tier, stadium and capacity satisfy the defined comparability rule. |
Baseline_Year_Used |
Gold | Baseline selection | 0 for Y0, -1 for an applied Y-1 substitution. |
Baseline_Substitution_Reason |
Gold | Baseline selection and comparability checks | Records applied substitution or rejection of an eligible COVID comparison. |
Covid_Baseline_Not_Comparable |
Gold | COVID event and metadata comparison | Eligible 2020-21 event fails the defined comparability rule. |
Covid_Baseline_Review_Flag |
Gold | Missing stadium/capacity metadata on both baseline rows | Substitution matches on both-missing metadata and requires review. |
Pct_Change_vs_Baseline |
Gold | Attendance and Baseline_Attendance | (Attendance minus Baseline_Attendance) divided by Baseline_Attendance. Fraction units. |
Pct_Change_vs_Baseline_Display |
Gold | Pct_Change_vs_Baseline | Fraction multiplied by 100. Percentage-number units. |
Pct_Change_Analysis |
Gold | Pct_Change_vs_Baseline_Display and relative year | Display-unit change with Y-1/Y0 missing. Consumer population filters are separate. |
Outcome_Group |
Gold | Event Y+1 Year_End_Outcome | Y+1 outcome repeated across all four rows. A missing Y+2 outcome can coexist with a known event group. |
Goals_For_Per_Game |
Gold | Goals_For_History and Games_Played_History | Goals for divided by games played. |
Points_Per_Game |
Gold | Points_History and Games_Played_History | Supplied points divided by games played. |
Is_Structural_Anomaly |
Gold | Curated event list | Middlesbrough 1992-93, Sunderland 1996-97, Leicester City 2001-02 and Bolton Wanderers 1995-96. Rows remain available for case studies. |
Plot_Group_Label |
Gold | Outcome_Group | Reader-facing label describing the first post-relegation outcome group. |
Is_Baseline_Substituted |
Gold | Baseline_Year_Used | True when Baseline_Year_Used equals -1. |
Row identity and analysis populations
Observation_ID is unique at event-year grain. Team and Season can repeat because relegation windows overlap. The underlying club-season attendance should agree, so overlapping windows are reconciled through a shared Team/Season decision.
The grouped article comparison selects Y+1/Y+2, excludes the four structural-anomaly events and requires a known Outcome_Group and attendance change. This currently gives 174 observations across 90 events. Requiring the current row’s Year_End_Outcome as an additional filter drops six observations and produces 168. The scatter should select +1/+2 explicitly. Case-study views intentionally retain the exceptional events.
Historical missing outcomes need an unavailable-data interpretation. An In progress label requires evidence that the season is ongoing. Display labels also need inclusion in the affected Power BI filters. These report edits are pending.
Audits and publication
Each candidate release has its own inputs, code, outputs and build log. Complete validation covers required files, CSV/Parquet agreement, unique keys, chronology, finite metrics and agreement of silver fields in gold. Only a validated candidate can replace outputs/current.json. Retained releases support rollback. Python readers resolve that pointer once for a complete read operation.
The manifest records artifact hashes, schemas, row counts, decision statuses, code revision/dirty state, the lockfile and runtime versions. Technical validation permits documented missing values and pending manual decisions. The source-quality review remains a distinct step.
The website’s release-provenance.json records the hashes of its own download files, the corresponding pipeline hashes and the logical-equality check. Differences in Parquet metadata can produce different file hashes for identical tables. This website snapshot is a separately pinned consumer. Updating the local pointer does not update website assets or the embedded online report.
Manual review gates
- Leicester City 2024-25 has recorded attendance values 31,448 and 31,740. Choose a canonical figure with source evidence in attendance_reconciliation.csv.
- Southampton 2024-25 has recorded values 30,865 and 31,147. Record the same kind of decision.
- Fulham 2022-23, Middlesbrough 1998-99 and West Bromwich Albion 2008-09 require manual capacity and attendance evidence. Record the season-specific capacity basis and any construction restrictions before selecting a correction.
- Standings patch references and the intended article/dashboard populations need release review. Capacity changes can affect baseline comparability.