Skip to content

Commit

Permalink
Update dim_user_levels to include content_area and topic_tags (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-springer authored Nov 26, 2024
2 parents aaef709 + 7ca522c commit b4f55ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions dbt/models/marts/users/dim_user_levels.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ combined as (
cs.level_script_id,

-- courses data
cs.content_area,
cs.course_name,
cs.is_active_student_course,
cs.topic_tags,

-- aggs
usl.time_spent_minutes,
Expand Down
14 changes: 10 additions & 4 deletions dbt/models/staging/dashboard/stg_dashboard__scripts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,17 @@ final as (
version_year,
is_standalone,
unit,
nullif(content_area,'') as content_area,
nullif(topic_tags_list,'') as topic_tags,
case
when course_name = 'hoc'
then 'hoc' -- If course_name is HOC, content area is HOC too
when content_area is null then 'other' -- If content area is null then 'other' to align with course_name
when content_area = '' then 'other' -- If content area is empty then 'other' to align with course_name
else content_area
end as content_area,
nullif(topic_tags_list,'') as topic_tags,
created_at,
updated_at
from renamed )

select *
from final
select *
from final

0 comments on commit b4f55ac

Please sign in to comment.