From 5b025b98bd982e8fd7e3a33a47e0e53e82875af5 Mon Sep 17 00:00:00 2001 From: Tudor Sitaru Date: Thu, 2 Apr 2026 15:33:04 +0100 Subject: [PATCH] fix(dim_school): use case-insensitive comparison for phase inference GIAS provides 'Not Applicable' (capital A) but the check used 'Not applicable', so the case-sensitive != matched true and skipped the age-range inference. Co-Authored-By: Claude Opus 4.6 --- pipeline/transform/models/marts/dim_school.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipeline/transform/models/marts/dim_school.sql b/pipeline/transform/models/marts/dim_school.sql index 014acbe..c2fc641 100644 --- a/pipeline/transform/models/marts/dim_school.sql +++ b/pipeline/transform/models/marts/dim_school.sql @@ -15,7 +15,7 @@ select s.local_authority_code * 1000 + s.establishment_number as laestab, s.school_name, case - when s.phase is not null and s.phase != 'Not applicable' then s.phase + when s.phase is not null and lower(s.phase) != 'not applicable' then s.phase when s.statutory_high_age is not null and s.statutory_high_age <= 11 then 'Primary' when s.statutory_low_age is not null and s.statutory_low_age >= 11 then 'Secondary' when s.statutory_low_age is not null and s.statutory_high_age is not null