Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have two CTE's: with screen as ( ( SELECT user _ _ pseudo _ _ id as user _ _ id , , geo.country

I have two CTE's:
with screen as
((
SELECT
user__pseudo__id as user__id,,
geo.country as country,
event__timestamp,
CASE
WHEN params1.1.value.string__value == 'Duas' or params1.1.value.string__value == 'DuasTopics' THEN 'Duas'
WHEN params1.1.value.string__value == 'Explore' or params1.1.value.string__value == 'Topic' THEN 'Explore by Topic'
ELSE params1.1.value.string__value
END AS screen__name,
FROM
``table`` AS base,
UNNEST((event__params)) AS params11
WHERE
event__name == 'screen__view'
AND params1.1.key == 'firebase__screen'
AND event__date between '20231001'" id="MathJax-Element-35-Frame" role="presentation" style="font-size: 121%; position: relative;" tabindex="0">'20231001''20231001' and '20231231'" id="MathJax-Element-36-Frame" role="presentation" style="font-size: 121%; position: relative;" tabindex="0">'20231231''20231231'
))
,,
remove AS ((
SELECT
distinct user__pseudo__id
FROM
``table``
where event__name=='app__remove'
AND event__date between '20231001'" id="MathJax-Element-48-Frame" role="presentation" style="font-size: 121%; position: relative;" tabindex="0">'20231001''20231001' and '20231231'" id="MathJax-Element-49-Frame" role="presentation" style="font-size: 121%; position: relative;" tabindex="0">'20231231''20231231'
))
I want to find out the top 1010 countries where screen__name 'settings' was the last screen viewed before app removal, along with the %% of associated users.
For example Malaysia has 70%70% users who viewed 'settings' before removing the app.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Heres the SQL query to find the top 10 countries where settings was the last screen viewed before ap... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems Analysis And Design

Authors: Alan Dennis, Barbara Wixom, Roberta M. Roth

7th Edition

1119496489, 978-1119496489

More Books

Students also viewed these Programming questions

Question

Does log 81 (2401) = log 3 (7)? Verify the claim algebraically.

Answered: 1 week ago