Created
November 1, 2017 23:08
-
-
Save saptarshiguha/ec18676a6a8316c27383471d805616e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## For Session Hours Per Day Per Profile | |
### For profiles on 56 | |
with a as ( | |
select client_id, submission_date_s3, sum(subsession_length)/3600 as hours | |
from main_summary | |
where app_name='Firefox' | |
and normalized_channel='release' | |
and substring(app_version,1,2)='56' | |
and submission_date_s3 >= '20170925' | |
and subsession_length<=86400 and subsession_length>=0 | |
group by 1,2 | |
) | |
select submission_date_s3, avg(hours),geometric_mean(hours) from a group by submission_date_s3 order by 1 | |
### For ALL profiles, but similar time periods | |
with a as ( | |
select client_id, submission_date_s3, sum(subsession_length)/3600 as hours | |
from main_summary | |
where app_name='Firefox' | |
and submission_date_s3 >= '20170925' | |
and normalized_channel='release' | |
and subsession_length<=86400 and subsession_length>=0 | |
group by 1,2 | |
) | |
select submission_date_s3, avg(hours),geometric_mean(hours) from a group by submission_date_s3 order by 1 | |
## Pages Visited | |
### For profiles on 56 | |
with a as ( | |
select client_id, submission_date_s3, sum(scalar_parent_browser_engagement_total_uri_count ) as turi | |
from main_summary | |
where app_name='Firefox' | |
and substring(app_version,1,2)='56' | |
and normalized_channel='release' | |
and submission_date_s3 >= '20170925' | |
and subsession_length<=86400 and subsession_length>=0 | |
group by 1,2 | |
) | |
select submission_date_s3, avg(turi ),geometric_mean(turi) from a group by submission_date_s3 order by 1 | |
### For ALL profiles, but similar time periods | |
with a as ( | |
select client_id, submission_date_s3, sum(scalar_parent_browser_engagement_total_uri_count ) as turi | |
from main_summary | |
where app_name='Firefox' | |
and normalized_channel='release' | |
and submission_date_s3 >= '20170925' | |
and subsession_length<=86400 and subsession_length>=0 | |
group by 1,2 | |
) | |
select submission_date_s3, avg(turi ),geometric_mean(turi) from a group by submission_date_s3 order by 1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment