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

feat: Turn active_users_aggregates Looker view into a derived_table to enable parameterisation #984

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all 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
146 changes: 144 additions & 2 deletions combined_browser_metrics/views/active_users_aggregates.view.lkml
Original file line number Diff line number Diff line change
@@ -1,6 +1,47 @@
include: "//looker-hub/combined_browser_metrics/views/active_users_aggregates.view.lkml"

view: +active_users_aggregates {
view: active_users_aggregates {
derived_table: {
sql:
SELECT
segment,
attribution_medium,
attribution_source,
attributed,
adjust_network,
install_source,
city,
country,
distribution_id,
first_seen_year,
is_default_browser,
channel,
os,
os_version,
os_version_major,
os_version_minor,
submission_date,
locale,
dau,
wau,
mau,
daily_users,
weekly_users,
monthly_users,
app_name,
app_version,
app_version_major,
app_version_minor,
app_version_patch_revision,
app_version_is_major_release,
os_grouped,
FROM `moz-fx-data-shared-prod.telemetry.active_users_aggregates`
WHERE
1 = 1
{% if distribution._parameter_value != "any" %}
AND distribution_id LIKE '%{% parameter distribution._parameter_value %}%'
{% endif %}
;;
}

parameter: choose_breakdown {
label: "Choose Grouping (Rows)"
Expand All @@ -26,6 +67,21 @@ view: +active_users_aggregates {
allowed_value: {value: "Week"}
}

parameter: distribution {
label: "Firefox Distribution"
view_label: "Firefox Distribution"
type: unquoted
default_value: "any"
allowed_value: {
label: "Vivo"
value: "vivo"
}
allowed_value: {
label: "Any"
value: "any"
}
}

dimension_group: submission {
type: time
view_label: "Date/Period Selection"
Expand Down Expand Up @@ -121,6 +177,92 @@ view: +active_users_aggregates {
sql: ${TABLE}.attribution_source ;;
}

dimension: adjust_network {
sql: ${TABLE}.adjust_network ;;
type: string
}

dimension: app_version_is_major_release {
sql: ${TABLE}.app_version_is_major_release ;;
type: yesno
}

dimension: app_version_major {
sql: ${TABLE}.app_version_major ;;
type: number
}

dimension: app_version_minor {
sql: ${TABLE}.app_version_minor ;;
type: number
}

dimension: app_version_patch_revision {
sql: ${TABLE}.app_version_patch_revision ;;
type: number
}

dimension: attributed {
sql: ${TABLE}.attributed ;;
type: yesno
}

dimension: channel {
sql: ${TABLE}.channel ;;
type: string
}

dimension: city {
sql: ${TABLE}.city ;;
type: string
}

dimension: country {
sql: ${TABLE}.country ;;
type: string
map_layer_name: countries
}

dimension: daily_users {
sql: ${TABLE}.daily_users ;;
type: number
}

dimension: distribution_id {
sql: ${TABLE}.distribution_id ;;
type: string
}

dimension: first_seen_year {
sql: ${TABLE}.first_seen_year ;;
type: number
}

dimension: install_source {
sql: ${TABLE}.install_source ;;
type: string
}

dimension: locale {
sql: ${TABLE}.locale ;;
type: string
}

dimension: monthly_users {
sql: ${TABLE}.monthly_users ;;
type: number
}

dimension: segment {
sql: ${TABLE}.segment ;;
type: string
}

dimension: weekly_users {
sql: ${TABLE}.weekly_users ;;
type: number
}

dimension: is_leap_year {
type: yesno
sql: MOD(EXTRACT(YEAR FROM ${TABLE}.submission_date), 4) = 0
Expand Down