From e2414c063c17cc36878490ae9920b6e4d102c62e Mon Sep 17 00:00:00 2001 From: Cory Kind Date: Tue, 17 Dec 2024 20:58:12 +0000 Subject: [PATCH 1/2] fixing cal_year to be the calendar year for HOC NOTE: also removes country_code. This will be added back in when we release the country fix later this week --- dbt/models/marts/hoc/dim_hoc_starts.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dbt/models/marts/hoc/dim_hoc_starts.sql b/dbt/models/marts/hoc/dim_hoc_starts.sql index 91c54f8d..9eb21994 100644 --- a/dbt/models/marts/hoc/dim_hoc_starts.sql +++ b/dbt/models/marts/hoc/dim_hoc_starts.sql @@ -19,8 +19,8 @@ internal_tutorials as ( final as ( select hoc_activity.hoc_start_id - , hoc_activity.started_at - , sy.school_year_int as cal_year + , hoc_activity.started_at as started_at + , extract(year from hoc_activity.started_at) as cal_year , sy.school_year --, hoc_activity.referer , hoc_activity.company @@ -34,11 +34,11 @@ final as ( then 1 else 0 end as is_flagged_for_quality - , hoc_activity.city - , hoc_activity.country + , lower(hoc_activity.city) as city + , lower(hoc_activity.country) as country , hoc_activity.state , hoc_activity.state_code - , hoc_activity.country_code + --, hoc_activity.country_code from hoc_activity join school_years as sy on hoc_activity.started_at From 9b4703c81736d75fd641aec70a62d82c411b307d Mon Sep 17 00:00:00 2001 From: Cory Kind Date: Tue, 17 Dec 2024 21:51:54 +0000 Subject: [PATCH 2/2] taking out the lowercase edits --- dbt/models/marts/hoc/dim_hoc_starts.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbt/models/marts/hoc/dim_hoc_starts.sql b/dbt/models/marts/hoc/dim_hoc_starts.sql index 9eb21994..0fc83522 100644 --- a/dbt/models/marts/hoc/dim_hoc_starts.sql +++ b/dbt/models/marts/hoc/dim_hoc_starts.sql @@ -34,8 +34,8 @@ final as ( then 1 else 0 end as is_flagged_for_quality - , lower(hoc_activity.city) as city - , lower(hoc_activity.country) as country + , hoc_activity.city as city + , hoc_activity.country as country , hoc_activity.state , hoc_activity.state_code --, hoc_activity.country_code