Skip to content

Commit

Permalink
segment results by profile age
Browse files Browse the repository at this point in the history
  • Loading branch information
florezita committed Jul 25, 2023
1 parent 9929952 commit 6a6e905
Showing 1 changed file with 60 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
[metrics]
overall = ['fxa_signed_in']
weekly = ['fxa_signed_in']
weekly = ['fxa_signed_in']

[segments]

[segments.lessthan_1mo]
select_expression = """COALESCE(ANY_VALUE(profile_age_segment_device_migration) = 'profile age less than 1 mo', FALSE)"""
data_source = 'clients_last_seen_with_profileage_segments'
window_start = 0
window_end = 0

[segments.one_to_six_mo]
select_expression = """COALESCE(ANY_VALUE(profile_age_segment_device_migration) = 'profile age between 1 and 6 mo', FALSE)"""
data_source = 'clients_last_seen_with_profileage_segments'
window_start = 0
window_end = 0

[segments.six_to_twelve_mo]
select_expression = """COALESCE(ANY_VALUE(profile_age_segment_device_migration) = 'profile age between 6 and 12 mo', FALSE)"""
data_source = 'clients_last_seen_with_profileage_segments'
window_start = 0
window_end = 0

[segments.one_to_two_years]
select_expression = """COALESCE(ANY_VALUE(profile_age_segment_device_migration) = 'profile age between 1 and 2 years', FALSE)"""
data_source = 'clients_last_seen_with_profileage_segments'
window_start = 0
window_end = 0

[segments.two_plus_years]
select_expression = """COALESCE(ANY_VALUE(profile_age_segment_device_migration) = 'profile age more than 2 years', FALSE)"""
data_source = 'clients_last_seen_with_profileage_segments'
window_start = 0
window_end = 0

[segments.data_sources]

[segments.data_sources.clients_last_seen_with_profileage_segments]
from_expression = """(
SELECT
*,
CASE WHEN DATE_DIFF(submission_date, first_run_date, DAY) < 28 THEN 'profile age less than 1 mo'
WHEN DATE_DIFF(submission_date, first_run_date, DAY) BETWEEN 28 AND 179 THEN 'profile age between 1 and 6 mo'
WHEN DATE_DIFF(submission_date, first_run_date, DAY) BETWEEN 180 AND 364 THEN 'profile age between 6 and 12 mo'
WHEN DATE_DIFF(submission_date, first_run_date, DAY) BETWEEN 365 AND 729 THEN 'profile age between 1 and 2 years'
WHEN DATE_DIFF(submission_date, first_run_date, DAY) >= 730 THEN 'profile age more than 2 years'
END AS profile_age_segment_device_migration
FROM mozdata.telemetry.clients_last_seen
)"""
window_start = 0
window_end = 0

[experiment]

segments = [
'lessthan_1mo',
'one_to_six_mo',
'six_to_twelve_mo',
'one_to_two_years',
'two_plus_years'
]

0 comments on commit 6a6e905

Please sign in to comment.