From 14b22355d1b19958b9e48f13250c23442523f930 Mon Sep 17 00:00:00 2001 From: kik-kik Date: Tue, 14 Jan 2025 16:29:08 +0100 Subject: [PATCH] feat: make sure that device_manufacturer is lowered prior to joining --- .../mobile_kpi_support_metrics/templates/engagement.query.sql | 2 +- .../mobile_kpi_support_metrics/templates/new_profiles.query.sql | 2 +- .../mobile_kpi_support_metrics/templates/retention.query.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sql_generators/mobile_kpi_support_metrics/templates/engagement.query.sql b/sql_generators/mobile_kpi_support_metrics/templates/engagement.query.sql index e6ef72badd9..18fd79d8424 100644 --- a/sql_generators/mobile_kpi_support_metrics/templates/engagement.query.sql +++ b/sql_generators/mobile_kpi_support_metrics/templates/engagement.query.sql @@ -3,7 +3,7 @@ WITH device_manufacturer_counts AS ( SELECT submission_date, device_manufacturer, - DENSE_RANK() OVER(PARTITION BY submission_date ORDER BY COUNT(*) DESC) AS manufacturer_rank, + RANK() OVER(PARTITION BY submission_date ORDER BY COUNT(*) DESC) AS manufacturer_rank, FROM `{{ project_id }}.{{ dataset }}.engagement_clients` WHERE diff --git a/sql_generators/mobile_kpi_support_metrics/templates/new_profiles.query.sql b/sql_generators/mobile_kpi_support_metrics/templates/new_profiles.query.sql index c5fedabe8da..6f6c6382af0 100644 --- a/sql_generators/mobile_kpi_support_metrics/templates/new_profiles.query.sql +++ b/sql_generators/mobile_kpi_support_metrics/templates/new_profiles.query.sql @@ -3,7 +3,7 @@ WITH device_manufacturer_counts AS ( SELECT first_seen_date, device_manufacturer, - DENSE_RANK() OVER(PARTITION BY submission_date ORDER BY COUNT(*) DESC) AS manufacturer_rank, + RANK() OVER(PARTITION BY first_seen_date ORDER BY COUNT(*) DESC) AS manufacturer_rank, FROM `{{ project_id }}.{{ dataset }}.new_profile_clients` WHERE diff --git a/sql_generators/mobile_kpi_support_metrics/templates/retention.query.sql b/sql_generators/mobile_kpi_support_metrics/templates/retention.query.sql index 236879fbaea..56d8e14a68e 100644 --- a/sql_generators/mobile_kpi_support_metrics/templates/retention.query.sql +++ b/sql_generators/mobile_kpi_support_metrics/templates/retention.query.sql @@ -3,7 +3,7 @@ WITH device_manufacturer_counts AS ( SELECT submission_date, device_manufacturer, - DENSE_RANK() OVER(PARTITION BY submission_date ORDER BY COUNT(*) DESC) AS manufacturer_rank, + RANK() OVER(PARTITION BY submission_date ORDER BY COUNT(*) DESC) AS manufacturer_rank, FROM `{{ project_id }}.{{ dataset }}.retention_clients` WHERE