Skip to content

Commit

Permalink
fix: add coursekey to output
Browse files Browse the repository at this point in the history
  • Loading branch information
saraburns1 committed Sep 10, 2024
1 parent 9124bb2 commit 2d7ae0e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{% if filter_values("tag") != [] %}
and course_key in (
select course_key
from {{ DBT_PROFILE_TARGET_DATABASE }}.course_tags a
from {% endraw -%} {{ DBT_PROFILE_TARGET_DATABASE }}.course_tags{%- raw %}
where
tag in (select replaceAll(arrayJoin({{ filter_values("tag") }}), '- ', ''))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ select
case
when flfc.emission_time >= subtractDays(now(), 7) then actor_id else null
end as active_learner,
tag as course_tag
tag as course_tag,
fes.course_key as course_key
from {{ DBT_PROFILE_TARGET_DATABASE }}.fact_enrollment_status fes
left join
{{ ASPECTS_XAPI_DATABASE }}.fact_learner_last_course_visit flfc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ select
and enrollment_status = 'registered'
then 'at-risk'
else 'other'
end as learner_status
from {{ DBT_PROFILE_TARGET_DATABASE }}.fact_student_status
end as learner_status,
fss.course_key as course_key
from {{ DBT_PROFILE_TARGET_DATABASE }}.fact_student_status fss
left join {{ ASPECTS_XAPI_DATABASE }}.fact_learner_last_course_visit fllcv
using org, course_key, actor_id
where 1 = 1 {% include 'openedx-assets/queries/common_filters.sql' %}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ select
totals.org as org,
names.course_name as course_name,
names.course_run as course_run,
duration.course_key as course_key,
count_videos,
avg_video_length,
video_duration,
Expand Down

0 comments on commit 2d7ae0e

Please sign in to comment.