-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #974 from saraburns1/testing_fixes
fix: fix enrollment count, video count, tag filter
- Loading branch information
Showing
6 changed files
with
49 additions
and
33 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
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
19 changes: 11 additions & 8 deletions
19
tutoraspects/templates/openedx-assets/queries/tag_filter_dataset.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 |
---|---|---|
@@ -1,12 +1,15 @@ | ||
with | ||
data as ( | ||
select id, rownum, tag, course_key | ||
from | ||
( | ||
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, | ||
multiIf(parent = 0, id, CAST(parent, 'int')) as sort_order_1, | ||
multiIf(parent = 0, 0, 1) 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 | ||
row_number() over ( | ||
order by sort_order_1 ASC, sort_order_2 ASC, value ASC | ||
) as rownum | ||
from {{ ASPECTS_EVENT_SINK_DATABASE }}.most_recent_tags | ||
) | ||
select id, rownum, tag | ||
from data | ||
) as t | ||
left join | ||
{{ DBT_PROFILE_TARGET_DATABASE }}.most_recent_course_tags ct on ct.tag_id = t.id |