Skip to content

Commit

Permalink
fix: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
saraburns1 committed Sep 6, 2024
1 parent 6f0ea77 commit 48e7af5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ select
course_run,
fes.actor_id as actor_id,
fes.enrollment_mode as enrollment_mode,
case when flfc.emission_time >= subtractDays(now(), 7) then actor_id else null end as active_learner,
case
when flfc.emission_time >= subtractDays(now(), 7) then actor_id else null
end as active_learner,
tag as course_tag
from {{ DBT_PROFILE_TARGET_DATABASE }}.fact_enrollment_status fes
left join
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
select
org,
actor_id,
course_name,
course_run,
approving_state,
case when fllcv.emission_time >= subtractDays(now(),7) then 'active'
when fllcv.emission_time < subtractDays(now(),7) and approving_state = 'failed'
and enrollment_status = 'registered' then 'at-risk'
else 'other' end as learner_status
org,
actor_id,
course_name,
course_run,
approving_state,
case
when fllcv.emission_time >= subtractDays(now(), 7)
then 'active'
when
fllcv.emission_time < subtractDays(now(), 7)
and approving_state = 'failed'
and enrollment_status = 'registered'
then 'at-risk'
else 'other'
end as learner_status
from {{ DBT_PROFILE_TARGET_DATABASE }}.fact_student_status
left join {{ ASPECTS_XAPI_DATABASE }}.fact_learner_last_course_visit fllcv
using org, course_key, actor_id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
with data as (
select
id,
case when parent = 0 then id else cast(parent as int) end as sort_order_1,
case when parent = 0 then 0 else 1 end as sort_order_2,
concat(repeat('- ',countMatches(lineage,',')),value) as tag,
row_number() over (order by sort_order_1, sort_order_2, value) as rownum
from {{ ASPECTS_EVENT_SINK_DATABASE }}.most_recent_tags
) select id, rownum, tag from data
with
data as (
select
id,
case when parent = 0 then id else cast(parent as int) end as sort_order_1,
case when parent = 0 then 0 else 1 end as sort_order_2,
concat(repeat('- ', countMatches(lineage, ',')), value) as tag,
row_number() over (order by sort_order_1, sort_order_2, value) as rownum
from {{ ASPECTS_EVENT_SINK_DATABASE }}.most_recent_tags
)
select id, rownum, tag
from data

0 comments on commit 48e7af5

Please sign in to comment.