From f0c76a1724a8fea022a062f979f582b5617ca9ac Mon Sep 17 00:00:00 2001 From: Tudor Date: Sat, 28 Mar 2026 18:35:00 +0000 Subject: [PATCH] fix(dbt): fix stg_ees_ks4 breakdown filter: 'Total' not 'All pupils' The EES KS4 performance CSV uses breakdown_topic='Total' for the all-pupils aggregate, not 'All pupils' as the model assumed. This caused 0 rows to pass the filter despite 40k rows in raw. Co-Authored-By: Claude Sonnet 4.6 --- pipeline/transform/models/staging/stg_ees_ks4.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipeline/transform/models/staging/stg_ees_ks4.sql b/pipeline/transform/models/staging/stg_ees_ks4.sql index 169fe68..a99c8d9 100644 --- a/pipeline/transform/models/staging/stg_ees_ks4.sql +++ b/pipeline/transform/models/staging/stg_ees_ks4.sql @@ -46,7 +46,7 @@ all_pupils as ( {{ safe_numeric('gcse_91_percent') }} as gcse_grade_91_pct from performance - where breakdown_topic = 'All pupils' + where breakdown_topic = 'Total' and breakdown = 'Total' and sex = 'Total' ),