Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am using Bigquery. I am trying to find bounce percentage for each app version. A bounced user is defined as a user who first
I am using Bigquery.
I am trying to find bounce percentage for each app version. A bounced user is defined as a user who first launched the app in the selected date range, then removed the app in the selected date range after using the app only once, ie a single session.
Here is my code:
with launched as
select distinct userpseudoid as totaldistinctusers
FROM rayndeenapp.analyticsevents
where
userpseudoid in
SELECT distinct userpseudoid
FROM rayndeenapp.analyticsevents
WHERE
eventname 'firstopen'
AND eventdate
BETWEEN
@DSSTARTDATE AND @DSENDDATE
demolaunched as
SELECT
userpseudoid
country
operatingsystem,
devicebrand,
devicemodel,
oswithversion,
appinfoversion
trafficsourcename
language
FROM rayndeenapp.churnanalysis.userdemographics
where userpseudoid in select from launched
removed as
select distinct userpseudoid as totaldistinctusers
FROM rayndeenapp.analyticsevents
WHERE userpseudoid IN
SELECT distinct userpseudoid
FROM rayndeenapp.analyticsevents
WHERE eventname "appremove"
AND eventdate
BETWEEN
@DSSTARTDATE AND @DSENDDATE
AND eventname 'firstopen'
AND eventdate
BETWEEN
@DSSTARTDATE AND @DSENDDATE
counts as
select userpseudoid counteventname as eventcountss
from rayndeenapp.analyticsevents
where eventname'sessionstart'
and userpseudoid in select from removed
group by userpseudoid
dataset as
select distinct userpseudoid from counts where eventcountss
demobounced as
SELECT
userpseudoid
country
operatingsystem,
devicebrand,
devicemodel,
oswithversion,
appinfoversion
trafficsourcename
language
FROM rayndeenapp.churnanalysis.userdemographics
where userpseudoid in select from dataset
grouplaunched as
select appinfoversion countdistinct userpseudoid as launchedusers
from demolaunched
group by appinfoversion
groupbounced as
select appinfoversion countdistinct userpseudoid as bouncedusers
from demobounced
group by appinfoversion
order by bouncedusers desc
limit
final as
select grouplaunched.appinfoversion, groupbounced.bouncedusers roundbounceduserslaunchedusers as percentagebounced
from grouplaunched
right join groupbounced
on grouplaunched.appinfoversiongroupbounced.appinfoversion
select from final
where appinfoversion'null'
order by final.bouncedusers desc
I wanted to get this checked, because it is producing some unusual results.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started