0% found this document useful (0 votes)
65 views26 pages

Operation Analytics and Investigating Metric Spike

Operation analytics and investigating metric spike project for data analytics training. Inclues SQL queries and results.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views26 pages

Operation Analytics and Investigating Metric Spike

Operation analytics and investigating metric spike project for data analytics training. Inclues SQL queries and results.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Operation Analytics and Investigating Metric Spike

Project Description:
The purpose of this project is to perform the operational analysis for complete end to end operations of the
company to find out the areas where improvement is needed. The focus is on to improve and optimize the
operational process within the organization.

Metric spike is also an important part as we should know the reasons behind the rise and dip in particular metric
such as sales, daily engagement etc. These questions must be answered to further predict the overall growth or
decline of the company.

Case Study 1: Job Data Analysis


We will be working with a table named job_data with the following columns:
• job_id: Unique identifier of jobs
• actor_id: Unique identifier of actor
• event: The type of event (decision/skip/transfer).
• language: The Language of the content
• time_spent: Time spent to review the job in seconds.
• org: The Organization of the actor
• ds: The date in the format yyyy/mm/dd (stored as text).

We are analyzing this table and determining the following:


A) Jobs Reviewed Over Time: Calculate the number of jobs reviewed per hour for each day in November
2020.
B) Throughput Analysis: Calculate the 7-day rolling average of throughput. Additionally, explain whether
you prefer using the daily metric or the 7-day rolling average for throughput, and why.
C) Language Share Analysis: Calculate the percentage share of each language in the last 30 days.
D) Duplicate Rows Detection: Identify duplicate rows in the data.

Case Study 2: Investigating Metric Spike


You will be working with three tables:
• users: Contains one row per user, with descriptive information about that user’s account.
• events: Contains one row per event, where an event is an action that a user has taken (e.g., login,
messaging, search).
• email_events: Contains events specific to the sending of emails.

We are analyzing these tables and determining the following:


A) Weekly User Engagement: Measure the activeness of users on a weekly basis.
B) User Growth Analysis: Calculate the user growth for the product.
C) Weekly Retention Analysis: Calculate the weekly retention of users based on their sign-up cohort.
D) Weekly Engagement Per Device: Calculate the weekly engagement per device.
E) Email Engagement Analysis: Calculate the email engagement metrics.
Approach:
a. The first step is the creation of the database and tables. The tables can be created by importing the csv
files provided by the team in the workbench.
b. After the creation of database, the approach was fairly simple, to perform the analysis we’re executing
SQL queries to extract the required data such as jobs reviewed per hour, weekly rolling average,
monthly language share, duplicate rows, weekly activeness of users, user growth, weekly retention,
weekly engagement per device and email engagement.

Tech Slack Used:


I used MySQL Workbench 8.2 to interact with database and perform the analysis. It is chosen because of its
user-friendly interface and robust SQL development features.

Case Study 1: Job Data Analytics


A) Jobs Reviewed Over Time: Calculate the number of jobs reviewed per hour for each day in November
2020.
Query:
select
count(distinct job_id)/(30*24) as jobs_reviewed_per_hour
from job_data
where
ds between '11/1/2020' and '11/30/2020';

Output:
jobs_reviewed_per_hour
0.0083

B) Throughput Analysis: Calculate the 7-day rolling average of throughput. Additionally, explain whether
you prefer using the daily metric or the 7-day rolling average for throughput, and why.
Query:
select
ds, job_reviewed, avg(job_reviewed)
over
(order by ds rows between 6 preceding and current row) as throughput
from
(select ds, count(distinct job_id) as job_reviewed
from job_data
where ds between '11/1/2020' and '11/30/2020'
group by ds
order by ds)a;

Output:
ds job_reviewed throughtput
11/25/2020 1 1.0000
11/26/2020 1 1.0000
11/27/2020 1 1.0000
11/28/2020 2 1.2500
11/29/2020 1 1.2000
11/30/2020 2 1.3333

C) Language Share Analysis: Calculate the percentage share of each language in the last 30 days.
Query:
select language, round(((count(language)/8)*100), 2) as percent_of_language
from job_data
group by language;

Output:
language percent_of_language
English 12.50
Arabic 12.50
Persian 37.50
Hindi 12.50
French 12.50
Italian 12.50

D) Duplicate Rows Detection: Identify duplicate rows in the data.


Query:
select * from job_data
where job_id in (select job_id
from job_data
group by job_id
having count(*) > 1);

Output:
ds job_id actor_id event language time_spent org
11/29/2020 23 1003 decision Persian 20 C
11/28/2020 23 1005 transfer Persian 22 D
11/26/2020 23 1004 skip Persian 56 A
Case Study 2: Investigating Metric Spike
A) Weekly User Engagement: Measure the activeness of users on a weekly basis.
Query:
select
extract(week from occurred_at) as num_week, count(distinct user_id) as no_of_distinct_user
from events
group by num_week;

Output:
num_week no_of_distinct_user
18 791
19 1244
20 1270
21 1341
22 1293
23 1366
24 1434
25 1462
26 1443
27 1477
28 1556
29 1556
30 1593
31 1685
32 1483
33 1438
34 1412
35 1442

B) User Growth Analysis: Calculate the user growth for the product.
Query:
select year, week_num, no_of_active_users, sum(no_of_active_users)
over
(order by year, week_num rows between unbounded preceding and current row)
cum_active_users from
(select extract(year from a.activated_at) as year,
extract(week from a.activated_at) as week_num,
count(distinct user_id) no_of_active_users
from users a
where state = 'active'
group by week_num, year)a;

Output:
year week_num no_of_active_users cum_active_users
2013 0 23 23
2013 1 30 53
2013 2 48 101
2013 3 36 137
2013 4 30 167
2013 5 48 215
2013 6 38 253
2013 7 42 295
2013 8 34 329
2013 9 43 372
2013 10 32 404
2013 11 31 435
2013 12 33 468
2013 13 39 507
2013 14 35 542
2013 15 43 585
2013 16 46 631
2013 17 49 680
2013 18 44 724
2013 19 57 781
2013 20 39 820
2013 21 49 869
2013 22 54 923
2013 23 50 973
2013 24 45 1018
2013 25 57 1075
2013 26 56 1131
2013 27 52 1183
2013 28 72 1255
2013 29 67 1322
2013 30 67 1389
2013 31 67 1456
2013 32 71 1527
2013 33 73 1600
2013 34 78 1678
2013 35 63 1741
2013 36 72 1813
2013 37 85 1898
2013 38 90 1988
2013 39 84 2072
2013 40 87 2159
2013 41 73 2232
2013 42 99 2331
2013 43 89 2420
2013 44 96 2516
2013 45 91 2607
2013 46 88 2695
2013 47 102 2797
2013 48 97 2894
2013 49 116 3010
2013 50 124 3134
2013 51 102 3236
2013 52 47 3283
2014 0 83 3366
2014 1 126 3492
2014 2 109 3601
2014 3 113 3714
2014 4 130 3844
2014 5 133 3977
2014 6 135 4112
2014 7 125 4237
2014 8 129 4366
2014 9 133 4499
2014 10 154 4653
2014 11 130 4783
2014 12 148 4931
2014 13 167 5098
2014 14 162 5260
2014 15 164 5424
2014 16 179 5603
2014 17 170 5773
2014 18 163 5936
2014 19 185 6121
2014 20 176 6297
2014 21 183 6480
2014 22 196 6676
2014 23 196 6872
2014 24 229 7101
2014 25 207 7308
2014 26 201 7509
2014 27 222 7731
2014 28 215 7946
2014 29 221 8167
2014 30 238 8405
2014 31 193 8598
2014 32 245 8843
2014 33 261 9104
2014 34 259 9363
2014 35 18 9381

C) Weekly Retention Analysis: Calculate the weekly retention of users based on their sign-up cohort.
Query:
select extract(week from occured_at) as weeks,
count(distinct user_id) as no_of_users
from events
where
event_type = "signup_flow" and event_name = "complete_signup"
group by weeks order by weeks;

Output:
weeks no_of_users
17 72
18 163
19 185
20 176
21 183
22 196
23 196
24 229
25 207
26 201
27 222
28 215
29 221
30 238
31 193
32 245
33 261
34 259
35 18
D) Weekly Engagement Per Device: Calculate the weekly engagement per device.
Query:
select device, extract(week from occured_at) as weeks,
count(distinct user_id) as no_of_users
from events
where event_type = "engagement"
group by device, weeks order by weeks;

Output:
device weeks no_of_users
acer aspire
17 9
desktop
acer aspire
17 20
notebook
amazon fire
17 4
phone
asus
17 21
chromebook
dell inspiron
17 18
desktop
dell inspiron
17 46
notebook
hp pavilion
17 14
desktop
htc one 17 16
ipad air 17 27
ipad mini 17 19
iphone 4s 17 21
iphone 5 17 65
iphone 5s 17 42
kindle fire 17 6
lenovo
17 86
thinkpad
mac mini 17 6
macbook air 17 54
macbook pro 17 143
nexus 10 17 16
nexus 5 17 40
nexus 7 17 18
nokia lumia
17 17
635
samsumg
17 8
galaxy tablet
samsung
17 7
galaxy note
samsung
17 52
galaxy s4
windows
17 10
surface
acer aspire
18 26
desktop
acer aspire
18 33
notebook
amazon fire
18 9
phone
asus
18 42
chromebook
dell inspiron
18 58
desktop
dell inspiron
18 77
notebook
hp pavilion
18 37
desktop
htc one 18 19
ipad air 18 52
ipad mini 18 30
iphone 4s 18 46
iphone 5 18 113
iphone 5s 18 73
kindle fire 18 27
lenovo
18 153
thinkpad
mac mini 18 13
macbook air 18 121
macbook pro 18 252
nexus 10 18 30
nexus 5 18 73
nexus 7 18 30
nokia lumia
18 33
635
samsumg
18 11
galaxy tablet
samsung
18 15
galaxy note
samsung
18 82
galaxy s4
windows
18 10
surface
acer aspire
19 23
desktop
acer aspire
19 41
notebook
amazon fire
19 12
phone
asus
19 27
chromebook
dell inspiron
19 36
desktop
dell inspiron
19 83
notebook
hp pavilion
19 40
desktop
htc one 19 30
ipad air 19 55
ipad mini 19 36
iphone 4s 19 44
iphone 5 19 115
iphone 5s 19 79
kindle fire 19 21
lenovo
19 178
thinkpad
mac mini 19 18
macbook air 19 112
macbook pro 19 266
nexus 10 19 25
nexus 5 19 87
nexus 7 19 41
nokia lumia
19 23
635
samsumg
19 6
galaxy tablet
samsung
19 11
galaxy note
samsung
19 91
galaxy s4
windows
19 16
surface
acer aspire
20 23
desktop
acer aspire
20 40
notebook
amazon fire
20 11
phone
asus
20 41
chromebook
dell inspiron
20 52
desktop
dell inspiron
20 84
notebook
hp pavilion
20 30
desktop
htc one 20 29
ipad air 20 59
ipad mini 20 32
iphone 4s 20 55
iphone 5 20 125
iphone 5s 20 79
kindle fire 20 23
lenovo
20 173
thinkpad
mac mini 20 26
macbook air 20 119
macbook pro 20 256
nexus 10 20 22
nexus 5 20 103
nexus 7 20 32
nokia lumia
20 22
635
samsumg
20 9
galaxy tablet
samsung
20 18
galaxy note
samsung
20 93
galaxy s4
windows
20 21
surface
acer aspire
21 29
desktop
acer aspire
21 47
notebook
amazon fire
21 5
phone
asus
21 38
chromebook
dell inspiron
21 41
desktop
dell inspiron
21 80
notebook
hp pavilion
21 44
desktop
htc one 21 21
ipad air 21 51
ipad mini 21 23
iphone 4s 21 45
iphone 5 21 137
iphone 5s 21 74
kindle fire 21 30
lenovo
21 167
thinkpad
mac mini 21 18
macbook air 21 110
macbook pro 21 247
nexus 10 21 25
nexus 5 21 91
nexus 7 21 29
nokia lumia
21 25
635
samsumg
21 6
galaxy tablet
samsung
21 20
galaxy note
samsung
21 84
galaxy s4
windows
21 17
surface
acer aspire
22 25
desktop
acer aspire
22 41
notebook
amazon fire
22 5
phone
asus
22 52
chromebook
dell inspiron
22 52
desktop
dell inspiron
22 92
notebook
hp pavilion
22 38
desktop
htc one 22 24
ipad air 22 58
ipad mini 22 34
iphone 4s 22 45
iphone 5 22 125
iphone 5s 22 71
kindle fire 22 21
lenovo
22 176
thinkpad
mac mini 22 25
macbook air 22 145
macbook pro 22 251
nexus 10 22 27
nexus 5 22 96
nexus 7 22 45
nokia lumia
22 25
635
samsumg
22 10
galaxy tablet
samsung
22 19
galaxy note
samsung
22 105
galaxy s4
windows
22 15
surface
acer aspire
23 22
desktop
acer aspire
23 43
notebook
amazon fire
23 16
phone
asus
23 49
chromebook
dell inspiron
23 53
desktop
dell inspiron
23 103
notebook
hp pavilion
23 54
desktop
htc one 23 20
ipad air 23 41
ipad mini 23 33
iphone 4s 23 53
iphone 5 23 152
iphone 5s 23 79
kindle fire 23 25
lenovo
23 176
thinkpad
mac mini 23 18
macbook air 23 124
macbook pro 23 266
nexus 10 23 45
nexus 5 23 88
nexus 7 23 36
nokia lumia
23 31
635
samsumg
23 14
galaxy tablet
samsung
23 14
galaxy note
samsung
23 99
galaxy s4
windows
23 14
surface
acer aspire
24 24
desktop
acer aspire
24 40
notebook
amazon fire
24 11
phone
asus
24 43
chromebook
dell inspiron
24 59
desktop
dell inspiron
24 99
notebook
hp pavilion
24 56
desktop
htc one 24 20
ipad air 24 57
ipad mini 24 39
iphone 4s 24 53
iphone 5 24 142
iphone 5s 24 79
kindle fire 24 25
lenovo
24 165
thinkpad
mac mini 24 29
macbook air 24 152
macbook pro 24 255
nexus 10 24 38
nexus 5 24 87
nexus 7 24 49
nokia lumia
24 35
635
samsumg
24 11
galaxy tablet
samsung
24 20
galaxy note
samsung
24 101
galaxy s4
windows
24 22
surface
acer aspire
25 28
desktop
acer aspire
25 47
notebook
amazon fire
25 13
phone
asus
25 38
chromebook
dell inspiron
25 52
desktop
dell inspiron
25 105
notebook
hp pavilion
25 52
desktop
htc one 25 21
ipad air 25 57
ipad mini 25 30
iphone 4s 25 40
iphone 5 25 137
iphone 5s 25 78
kindle fire 25 24
lenovo
25 197
thinkpad
mac mini 25 21
macbook air 25 121
macbook pro 25 275
nexus 10 25 29
nexus 5 25 89
nexus 7 25 51
nokia lumia
25 37
635
samsumg
25 12
galaxy tablet
samsung
25 14
galaxy note
samsung
25 99
galaxy s4
windows
25 22
surface
acer aspire
26 29
desktop
acer aspire
26 35
notebook
amazon fire
26 13
phone
asus
26 49
chromebook
dell inspiron
26 60
desktop
dell inspiron
26 89
notebook
hp pavilion
26 46
desktop
htc one 26 23
ipad air 26 56
ipad mini 26 43
iphone 4s 26 50
iphone 5 26 152
iphone 5s 26 94
kindle fire 26 26
lenovo
26 192
thinkpad
mac mini 26 11
macbook air 26 134
macbook pro 26 269
nexus 10 26 29
nexus 5 26 87
nexus 7 26 46
nokia lumia
26 42
635
samsumg
26 12
galaxy tablet
samsung
26 9
galaxy note
samsung
26 112
galaxy s4
windows
26 21
surface
acer aspire
27 29
desktop
acer aspire
27 49
notebook
amazon fire
27 10
phone
asus
27 52
chromebook
dell inspiron
27 53
desktop
dell inspiron
27 89
notebook
hp pavilion
27 56
desktop
htc one 27 27
ipad air 27 55
ipad mini 27 35
iphone 4s 27 67
iphone 5 27 163
iphone 5s 27 83
kindle fire 27 25
lenovo
27 202
thinkpad
mac mini 27 15
macbook air 27 142
macbook pro 27 302
nexus 10 27 37
nexus 5 27 84
nexus 7 27 40
nokia lumia
27 31
635
samsumg
27 15
galaxy tablet
samsung
27 15
galaxy note
samsung
27 116
galaxy s4
windows
27 33
surface
acer aspire
28 30
desktop
acer aspire
28 49
notebook
amazon fire
28 6
phone
asus
28 50
chromebook
dell inspiron
28 56
desktop
dell inspiron
28 103
notebook
hp pavilion
28 56
desktop
htc one 28 26
ipad air 28 54
ipad mini 28 35
iphone 4s 28 61
iphone 5 28 151
iphone 5s 28 93
kindle fire 28 31
lenovo
28 220
thinkpad
mac mini 28 28
macbook air 28 148
macbook pro 28 295
nexus 10 28 26
nexus 5 28 85
nexus 7 28 39
nokia lumia
28 35
635
samsumg
28 9
galaxy tablet
samsung
28 10
galaxy note
samsung
28 122
galaxy s4
windows
28 33
surface
acer aspire
29 28
desktop
acer aspire
29 53
notebook
amazon fire
29 12
phone
asus
29 49
chromebook
dell inspiron
29 54
desktop
dell inspiron
29 113
notebook
hp pavilion
29 58
desktop
htc one 29 31
ipad air 29 52
ipad mini 29 34
iphone 4s 29 60
iphone 5 29 144
iphone 5s 29 90
kindle fire 29 37
lenovo
29 209
thinkpad
mac mini 29 31
macbook air 29 148
macbook pro 29 295
nexus 10 29 25
nexus 5 29 77
nexus 7 29 45
nokia lumia
29 43
635
samsumg
29 13
galaxy tablet
samsung
29 16
galaxy note
samsung
29 123
galaxy s4
windows
29 28
surface
acer aspire
30 33
desktop
acer aspire
30 60
notebook
amazon fire
30 12
phone
asus
30 56
chromebook
dell inspiron
30 54
desktop
dell inspiron
30 127
notebook
hp pavilion
30 42
desktop
htc one 30 31
ipad air 30 70
ipad mini 30 35
iphone 4s 30 65
iphone 5 30 152
iphone 5s 30 103
kindle fire 30 25
lenovo
30 206
thinkpad
mac mini 30 23
macbook air 30 159
macbook pro 30 322
nexus 10 30 36
nexus 5 30 84
nexus 7 30 62
nokia lumia
30 34
635
samsumg
30 9
galaxy tablet
samsung
30 15
galaxy note
samsung
30 103
galaxy s4
windows
30 19
surface
acer aspire
31 31
desktop
acer aspire
31 55
notebook
amazon fire
31 14
phone
asus
31 56
chromebook
dell inspiron
31 44
desktop
dell inspiron
31 113
notebook
hp pavilion
31 51
desktop
htc one 31 13
ipad air 31 55
ipad mini 31 27
iphone 4s 31 56
iphone 5 31 135
iphone 5s 31 71
kindle fire 31 14
lenovo
31 207
thinkpad
mac mini 31 24
macbook air 31 147
macbook pro 31 321
nexus 10 31 24
nexus 5 31 69
nexus 7 31 38
nokia lumia
31 28
635
samsumg
31 8
galaxy tablet
samsung
31 14
galaxy note
samsung
31 100
galaxy s4
windows
31 19
surface
acer aspire
32 35
desktop
acer aspire
32 55
notebook
amazon fire
32 12
phone
asus
32 62
chromebook
dell inspiron
32 57
desktop
dell inspiron
32 104
notebook
hp pavilion
32 51
desktop
htc one 32 18
ipad air 32 48
ipad mini 32 30
iphone 4s 32 34
iphone 5 32 119
iphone 5s 32 67
kindle fire 32 12
lenovo
32 179
thinkpad
mac mini 32 20
macbook air 32 125
macbook pro 32 307
nexus 10 32 30
nexus 5 32 67
nexus 7 32 25
nokia lumia
32 28
635
samsumg
32 6
galaxy tablet
samsung
32 12
galaxy note
samsung
32 82
galaxy s4
windows
32 10
surface
acer aspire
33 39
desktop
acer aspire
33 46
notebook
amazon fire
33 14
phone
asus
33 49
chromebook
dell inspiron
33 37
desktop
dell inspiron
33 110
notebook
hp pavilion
33 38
desktop
htc one 33 19
ipad air 33 40
ipad mini 33 28
iphone 4s 33 35
iphone 5 33 110
iphone 5s 33 65
kindle fire 33 14
lenovo
33 191
thinkpad
mac mini 33 32
macbook air 33 133
macbook pro 33 312
nexus 10 33 23
nexus 5 33 70
nexus 7 33 30
nokia lumia
33 27
635
samsumg
33 12
galaxy tablet
samsung
33 13
galaxy note
samsung
33 80
galaxy s4
windows
33 15
surface
acer aspire
34 30
desktop
acer aspire
34 63
notebook
amazon fire
34 11
phone
asus
34 47
chromebook
dell inspiron
34 49
desktop
dell inspiron
34 105
notebook
hp pavilion
34 36
desktop
htc one 34 25
ipad air 34 39
ipad mini 34 25
iphone 4s 34 50
iphone 5 34 101
iphone 5s 34 70
kindle fire 34 13
lenovo
34 193
thinkpad
mac mini 34 30
macbook air 34 136
macbook pro 34 292
nexus 10 34 25
nexus 5 34 70
nexus 7 34 33
nokia lumia
34 17
635
samsumg
34 14
galaxy tablet
samsung
34 13
galaxy note
samsung
34 90
galaxy s4
windows
34 18
surface
acer aspire
35 1
desktop
acer aspire
35 3
notebook
asus
35 6
chromebook
dell inspiron
35 1
desktop
dell inspiron
35 9
notebook
hp pavilion
35 1
desktop
htc one 35 2
ipad mini 35 2
iphone 4s 35 6
iphone 5 35 2
iphone 5s 35 3
kindle fire 35 3
lenovo
35 16
thinkpad
mac mini 35 2
macbook air 35 10
macbook pro 35 17
nexus 10 35 2
nexus 5 35 4
nexus 7 35 2
nokia lumia
35 2
635
samsung
35 1
galaxy note
samsung
35 6
galaxy s4
windows
35 3
surface

E) Email Engagement Analysis: Calculate the email engagement metrics.


Query:
select
(sum(case when
email_category="email_opened" then 1 else 0 end)/sum(case when email_category="email_sent" then 1
else 0 end))*100 as open_rate,
(sum(case when
email_category="email_clickthrough" then 1 else 0 end)/sum(case when email_category="email_sent"
then 1 else 0 end))*100 as click_rate
from (
select *,
case
when action in ("sent_weekly_digest", "sent_reengagement_email") then ("email_sent")
when action in ("email_open") then ("email_opened")
when action in ("email_clickthrough") then ("email_clickthrough")
end as email_category
from email_events) as alias;

Output:
open_rate open_rate
33.5834 14.7899
Insights:
Learnt to leverage the advanced MySQL queries for analyzing the user data.
➢ For Case Study 1:
1. Jobs reviewed per hour is 0.0083
2. Average throughput of 30th November is the most i.e. 1.333
3. Persian is the most spoken language (37.50%)
4. There are 3 similar rows with job_id 23

➢ For Case Study 2:


1. Weekly user engagement increased from 18th week to 31st week and then started declining
2. There are total of 9381 users from January 2013 to December 2014
3. Most users use MacBook and iPhone
4. The email open rate is 33.5834% and click rate is 14.7899%

Result:
Learnt about the advanced SQL Queries. Also inferred that analysis of big datasets require more effort. How to
find the different areas where improvement can be done based on the analysis, how can we make the interface
more user friendly so they can engage more etc. was determined. Learnt about operational analysis and metric
spikes and how we can use them for the advantage of the organization by making proper analysis.

You might also like