Skip to content
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

fix: fix enrollment count, video count, tag filter #974

Merged
merged 4 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ params:
groupby:
- course_name
- org
- video_count
metrics:
- num_videos
- watched_percent
- rewatched_percent
- avg_video_length
Expand All @@ -28,6 +28,7 @@ params:
percent_metrics: []
query_mode: aggregate
row_limit: 50000
server_page_length: 10
show_cell_bars: false
table_timestamp_format: smart_date
temporal_columns_lookup: {}
Expand Down Expand Up @@ -55,8 +56,8 @@ query_context:
groupby:
- course_name
- org
- video_count
metrics:
- num_videos
- watched_percent
- rewatched_percent
- avg_video_length
Expand All @@ -67,6 +68,7 @@ query_context:
result_format: json
result_type: full
row_limit: 50000
server_page_length: 10
saraburns1 marked this conversation as resolved.
Show resolved Hide resolved
show_cell_bars: false
slice_id: 82
table_timestamp_format: smart_date
Expand All @@ -78,20 +80,20 @@ query_context:
columns:
- course_name
- org
- video_count
custom_form_data: {}
custom_params: {}
extras:
having: ''
where: ''
filters: []
metrics:
- num_videos
- watched_percent
- rewatched_percent
- avg_video_length
order_desc: true
orderby:
- - watched_percent
- - num_videos
- false
post_processing: []
row_limit: 50000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ params:
groupby:
- course_run
- course_name
- video_count
metrics:
- num_videos
- watched_percent
- rewatched_percent
- avg_video_length
Expand All @@ -28,6 +28,7 @@ params:
percent_metrics: []
query_mode: aggregate
row_limit: 50000
server_page_length: 10
show_cell_bars: false
table_timestamp_format: smart_date
temporal_columns_lookup: {}
Expand Down Expand Up @@ -55,8 +56,8 @@ query_context:
groupby:
- course_run
- course_name
- video_count
metrics:
- num_videos
- watched_percent
- rewatched_percent
- avg_video_length
Expand All @@ -67,8 +68,9 @@ query_context:
result_format: json
result_type: full
row_limit: 50000
server_page_length: 10
show_cell_bars: false
slice_id: 145
slice_id: 641
table_timestamp_format: smart_date
temporal_columns_lookup: {}
viz_type: table
Expand All @@ -78,20 +80,20 @@ query_context:
columns:
- course_run
- course_name
- video_count
custom_form_data: {}
custom_params: {}
extras:
having: ''
where: ''
filters: []
metrics:
- num_videos
- watched_percent
- rewatched_percent
- avg_video_length
order_desc: true
orderby:
- - watched_percent
- - num_videos
- false
post_processing: []
row_limit: 50000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ position:
children: []
id: CHART-explore-1508-1
meta:
chartId: 145
chartId: 641
height: 50
sliceName: Video Engagement
uuid: 6b7610a7-41d0-4d14-be81-62a5a8f22d62
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ metrics:
- currency: null
d3format: null
description: null
expression: uniq((active_learner,course_run))
expression: uniq(active_learner,course_run)
extra:
warning_markdown: ''
metric_name: active_count
Expand All @@ -125,7 +125,7 @@ metrics:
- currency: null
d3format: null
description: null
expression: uniq((actor_id,course_run))
expression: uniq(actor_id,course_run)
extra:
warning_markdown: ''
metric_name: enrollees
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ columns:
python_date_format: null
type: String
verbose_name: Tag
- advanced_data_type: null
column_name: course_key
description: null
expression: null
extra: {}
filterable: true
groupby: true
is_active: true
is_dttm: false
python_date_format: null
type: String
verbose_name: Course Key
database_uuid: 21174b6c-4d40-4958-8161-d6c3cf5e77b6
default_endpoint: null
description: null
Expand All @@ -50,7 +62,8 @@ metrics:
d3format: null
description: null
expression: COUNT(*)
extra: {}
extra:
warning_markdown: ''
metric_name: count
metric_type: count
verbose_name: COUNT(*)
Expand All @@ -59,7 +72,8 @@ metrics:
d3format: null
description: null
expression: min(rownum)
extra: {}
extra:
warning_markdown: ''
metric_name: order
metric_type: null
verbose_name: order
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@ _file_name: watched_video_duration.yaml
always_filter_main_dttm: false
cache_timeout: null
columns:
- advanced_data_type: null
column_name: video_count
description: null
expression: null
extra:
warning_markdown: null
filterable: true
groupby: true
is_active: true
is_dttm: false
python_date_format: null
type: UInt64
verbose_name: Number of Videos
- advanced_data_type: null
column_name: course_name
description: null
Expand Down Expand Up @@ -119,6 +106,18 @@ columns:
python_date_format: null
type: String
verbose_name: Org
- advanced_data_type: null
column_name: video_count
description: null
expression: null
extra: {}
filterable: true
groupby: true
is_active: true
is_dttm: false
python_date_format: null
type: Int32
verbose_name: Video Count
database_uuid: 21174b6c-4d40-4958-8161-d6c3cf5e77b6
default_endpoint: null
description: null
Expand Down
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
Loading