-
Notifications
You must be signed in to change notification settings - Fork 6
Add page_engagement_views_report #1915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
23fadef
6e549db
5d2bf86
2fbc92b
f82cc6e
990d5f2
4a59671
362148b
3dec2dd
4052c5d
c78f234
4fabe3e
67ac0d4
d413ea0
37949ba
a2b1d6f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| with page_engagement as ( | ||
| select * from {{ ref('afact_course_page_engagement') }} | ||
| ) | ||
|
|
||
| , dim_user as ( | ||
| select * from {{ ref('dim_user') }} | ||
| ) | ||
|
|
||
| , course_runs as ( | ||
| select | ||
| course_title | ||
| , courserun_readable_id | ||
| from {{ ref('int__combined__course_runs') }} | ||
| group by course_title, courserun_readable_id | ||
| ) | ||
|
|
||
| , unit_blocks as ( | ||
| select * from {{ ref('dim_course_content') }} | ||
| where block_category = 'vertical' | ||
| and is_latest = true | ||
| ) | ||
|
|
||
| , subsection_blocks as ( | ||
| select * from {{ ref('dim_course_content') }} | ||
| where is_latest = true | ||
| and block_category = 'sequential' | ||
| ) | ||
|
|
||
| , section_blocks as ( | ||
| select * from {{ ref('dim_course_content') }} | ||
| where is_latest = true | ||
|
quazi-h marked this conversation as resolved.
|
||
| and block_category = 'chapter' | ||
| ) | ||
|
Comment on lines
+23
to
+33
|
||
|
|
||
| select | ||
| dim_user.email as user_email | ||
| , dim_user.full_name | ||
| , page_engagement.platform | ||
| , page_engagement.courserun_readable_id | ||
| , page_engagement.block_fk | ||
| , page_engagement.openedx_user_id | ||
| , max(page_engagement.num_of_views) as num_of_views | ||
| , max(unit_blocks.block_title) as unit_title | ||
| , max(subsection_blocks.block_title) as subsection_title | ||
| , max(subsection_blocks.block_index) as subsection_block_index | ||
| , max(section_blocks.block_title) as section_title | ||
| , max(section_blocks.block_index) as section_block_index | ||
| , max(course_runs.course_title) as course_title | ||
| from page_engagement | ||
| left join unit_blocks | ||
| on page_engagement.block_fk = unit_blocks.block_id | ||
| left join subsection_blocks | ||
| on page_engagement.sequential_block_fk = subsection_blocks.block_id | ||
| left join section_blocks | ||
|
sentry[bot] marked this conversation as resolved.
|
||
| on page_engagement.chapter_block_fk = section_blocks.block_id | ||
| left join dim_user | ||
| on page_engagement.user_fk= dim_user.user_pk | ||
| left join course_runs | ||
| on page_engagement.courserun_readable_id = course_runs.courserun_readable_id | ||
| group by | ||
| dim_user.email | ||
| , dim_user.full_name | ||
| , page_engagement.platform | ||
| , page_engagement.courserun_readable_id | ||
| , page_engagement.block_fk | ||
|
sentry[bot] marked this conversation as resolved.
|
||
| , page_engagement.openedx_user_id | ||
Uh oh!
There was an error while loading. Please reload this page.