feat(pipeline): derive dim_school.has_sixth_form from GIAS flag
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -52,6 +52,14 @@ select
|
||||
s.religious_character,
|
||||
s.gender,
|
||||
s.statutory_low_age || '-' || s.statutory_high_age as age_range,
|
||||
-- Authoritative sixth-form flag (spec §3): GIAS OfficialSixthForm.
|
||||
-- "Not applicable" (nurseries, primaries, PRUs) => false. Blank GIAS
|
||||
-- value (rare, new establishments) falls back to the statutory age range.
|
||||
case
|
||||
when s.official_sixth_form = 'Has a sixth form' then true
|
||||
when s.official_sixth_form in ('Does not have a sixth form', 'Not applicable') then false
|
||||
else coalesce(s.statutory_high_age >= 18, false)
|
||||
end as has_sixth_form,
|
||||
s.capacity,
|
||||
s.total_pupils,
|
||||
concat_ws(' ', s.head_title, s.head_first_name, s.head_last_name) as headteacher_name,
|
||||
|
||||
Reference in New Issue
Block a user