-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
273 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
tutoraspects/templates/openedx-assets/queries/active_last_7_days.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
with | ||
recent_activity as ( | ||
select course_key, COUNT(DISTINCT actor_id) as active_last_7_days | ||
from {{DBT_PROFILE_TARGET_DATABASE}}.`navigation_events` | ||
where emission_time >= NOW() - INTERVAL 7 DAY | ||
group by course_key | ||
) | ||
|
||
select fss.*, COALESCE(ra.active_last_7_days, 0) as active_within_last_7_days | ||
from {{DBT_PROFILE_TARGET_DATABASE}}`fact_student_status` fss | ||
left join recent_activity ra on fss.course_key = ra.course_key |
Oops, something went wrong.