Archit Patel - Analysis File
Archit Patel - Analysis File
Key Definitions
-- Group ID: This is the unique identifier for the customer
-- Txn ID: This is the unique identifier for each transaction
-- Txn Date: This is the date the transaction occured
-- Txn_Type:
New: Customer has bought a subscription for the first time ever.
Upgrade: Customer has upgraded his/her existing subscription to one with a higher price
Downgrade: Customer has downgraded his/her existing subscription to one with a lower price
Addition: Customer has purchased an additional plan while currently paying for a plan. Post addition txn, customer will be
Churn: When a customer discontinues a plan, he/she is marked as churn. In the case where a customer has > 1 plan acti
Repurchase: Former customer has a bought a subscription. Repurchase can only occur post a Churn entry. If a customer
*Until the next transaction occurs, you can assume the customer is paying what he/she was paying as off t
-- MRR refers to Monthly Recurring Revenue. It's the revenue billed each month for the subscription servic
Link
-- MRR_Change is the incremental revenue change in the customer's subscription over and above the previous transaction. So
You can reference the "entry" and "exit" plan IDs in the Txns Data and look them up in Plan Prices to calculate the MRR_Cha
-- Cumulative MRR can be calculated by summing up MRR_Change entries for that customer in chronological order. This is th
-- Entry & Exit Plans tells you which plan the customer has bought vs. discontinued for each transaction
NRR for year XXXX = Exit ARR at year end XXXX for the same customer cohort from year (X
Exit ARR at year end (X
e.g. NRR for Dec 2019 = Exit ARR at Dec 2019 end for the same customer cohort from Dec
Exit ARR at Dec 2018
Assignment
1. Calculate the cumulative paying MRR for each of the 10 customers as of 01/01/2018. This is what these customers
2. There
3. What areareyour observations
multiple about
other issues the Txns
in the cumulative MRR ofCan
Data dataset. these customers?
you spot all theUsing Txns
issues? ForData or please
each, Plan Pr
(Hint: It's easier to spot these if you go through txns in a chronological order for each customer)
4. What plan is customer with group ID 118928 currently active on?
5. Please write query in SQL to solve the below set of questions:
a) Solve the 1st problem using SQL. The solution should include the following fields: Group_ID, Cumulativ
b) For the customers who are not churned, what is the current active plan and what is the MRR of the curre
c) Find the Trailing 12 months NRR from Dec 2017 to Dec 2018. The solution should include "Month" and
. All plans are billed monthly.
or the subscription service. Click on the link below to learn more about MRR and SaaS metrics.
ve the previous transaction. So If a customer buys a plan for $20/mo. and then upgrades to a plan which is $30/mo., the MRR_change for th
ces to calculate the MRR_Change
chronological order. This is the total amount / month the customer is paying us at a point in time.
stomer cohort from year (XXXX-1) who had non 0 exit ARR at year end (XXXX-1)
Exit ARR at year end (XXXX-1)
ustomer cohort from Dec 2018 end who had non 0 exit ARR at Dec 2018 end
Exit ARR at Dec 2018 end
ar Group IDs - Denominator; and one for the retained Group IDs - numerator)
Group_ID Txn_ID Txn_date Txn_type Entry_Plan_Value MRR_Change
2001 42 1/12/2018 New 458 458
2001 43 2/11/2018 Downgrade 321 -137
2001 44 3/13/2018 Churn 0 -321
7878 2 1/1/2016 New 194 194
7878 9 5/1/2016 Upgrade 144 -50
7878 30 7/1/2017 Churn 194 194
7878 31 8/1/2017 New 144 144
7878 33 9/1/2017 Downgrade 116 -28
7878 38 10/1/2017 Churn 0 -116
8892 24 4/1/2017 New 645 645
8892 26 5/1/2017 Downgrade 321 -281
8892 28 6/1/2017 Churn 0 -602
9554 5 4/1/2016 Upgrade 144 28
9554 8 5/1/2016 Downgrade 0 -62
9554 18 11/1/2016 Churn 0 -37
9823 19 1/1/2017 New 697 697
9823 21 2/1/2017 Upgrade 645 -52
9823 23 3/1/2017 Addition 602 602
9823 25 4/1/2017 Churn 0 -602
9823 27 5/1/2017 Churn 0 -645
10090 3 1/1/2016 New 557 557
10090 4 2/1/2016 Downgrade 479 -78
10090 11 6/1/2016 Upgrade 645 166
10090 34 9/1/2017 Churn 0 -645
10090 39 10/1/2017 Repurchase 666 666
10902 1 1/1/2015 New 479 479
10902 20 1/1/2017 Churn 0 -479
10902 22 2/1/2017 Repurchase 645 645
10902 29 6/1/2017 Addition 479 479
10902 32 9/1/2017 Downgrade 479 -166
10902 53 12/1/2018 Churn 0 -479
19198 7 4/5/2016 New 406 406
19198 14 9/8/2016 Addition 479 479
19198 16 10/10/2016 Churn 0 -406
19198 17 11/10/2016 Downgrade 321 -158
19198 35 9/1/2017 Churn 0 -321
19198 36 9/13/2017 Repurchase 321 321
19198 37 9/28/2017 Downgrade 406 85
19198 40 28/10/2017 Churn 0 -406
19198 41 26/11/2017 Addition 321 321
118928 45 3/28/2018 New 645 645
118928 46 4/17/2018 Upgrade 788 143
118928 47 5/12/2018 Downgrade 645 -143
118928 48 6/11/2018 Addition 666 666
118928 49 7/1/2018 Upgrade 697 31
118928 50 7/6/2018 Upgrade 788 91
118928 51 7/11/2018 Downgrade 557 -231
118928 52 7/16/2018 Churn 0 -645
190290 6 4/1/2016 New 260 260
190290 10 5/1/2016 Upgrade 291 31
190290 12 7/1/2016 Downgrade 215 -76
190290 13 9/1/2016 Addition 260 260
190290 15 10/1/2016 Churn 0 -260
MRR Entry_Plan Exit_Plan Status This sheet was created after sorting
458 14
321 10 14
0 10 Inactive
194 6 Three new columns has been added
144 5 6
338 6
482 5
454 4 5
338 4 Active
645 20
364 10 19
-238 19 Active
28 5 4
-34 3 5
-71 2 Active
697 23
645 20 23
1247 19
645 19
0 20 Inactive
557 18
479 15 18
645 20 15
0 20
666 21 Active
479 15
0 15
645 20
1124 15
958 15 20
479 15 Active
406 12
885 15
479 12
321 10 15
0 10
321 10
406 12 10
0 12
321 10 Active
645 20
788 25 20
645 20 25
1311 21
1342 23 21
1433 25 23
1202 18 25
557 20 Active
260 8
291 9 8
215 7 9
475 8
215 8 Active
This sheet was created after sorting the Txns_raw_data file and few columns were added/sorted for my understanding
Txn_Type Issue
MRR Issue
2. What are your observations about the cumulative MRR of these customers? Using Txns Data or Plan Pr
Added in the PPT
3. There are multiple other issues in the Txns Data dataset. Can you spot all the issues? For each, please
(Hint: It's easier to spot these if you go through txns in a chronological order for each customer)
Added in the PPT
SQL
a) Solve the 1st problem using SQL. The solution should include the following fields: Group_ID, Cumulativ
b) For the customers who are not churned, what is the current active plan and what is the MRR of the curre
c) Find the Trailing 12 months NRR from Dec 2017 to Dec 2018. The solution should include "Month" and
A SQL Tab has been created which gives idea about the subqueries written in order to write queries for the above 3 questions
Main subqueries have been added to the PPT
s is what these customers would be paying us as of that date.
g Txns Data or Plan Prices data, please explain how you will correct the cumulative MRRs of some of these custome
ues? For each, please provide the Txn ID, issue, and how you would go about correcting it.
h customer)
Group IDs - Denominator; and one for the retained Group IDs - numerator)
How to find if the customer is still active or not?
SELECT group_id
FROM transactions
GROUP BY group_id
HAVING SUM(CASE WHEN txn_type IN ('New','Addition','Repurchase') THEN 1 ELSE 0 END) > SUM(CASE WHEN
For the customers who are not churned, what is the current active plan and what is the MRR of the
WITH Entry AS (SELECT group_id As gpi, entry_plan , count(*) AS entry_count
FROM transactions
WHERE entry_plan IS not NULL
GROUP BY group_id, entry_plan
),
Exit_1 AS (SELECT group_id, exit_plan , count(*) AS exit_count
FROM transactions
WHERE exit_plan IS NOT NULL
GROUP BY group_id, exit_plan
)
SELECT gpi, entry_plan
FROM Entry
LEFT JOIN Exit_1 ON Entry.entry_plan = Exit_1.exit_plan and Entry.gpi = Exit_1.group_id
LEFT JOIN prices ON Entry.entry_plan = prices.plans
WHERE entry_count > exit_count OR exit_count IS NULL
ORDER BY gpi, entry_plan
How to calculate the MRR and no. of months between two consecutive transactions
SELECT *,
SUM(mrr_change) OVER (PARTITION BY group_id ORDER BY txn_date) AS MRR,
datediff(month,txn_date, lead(txn_date) OVER (PARTITION BY group_id ORDER BY txn_date)) AS months
FROM transactions
E 0 END) > SUM(CASE WHEN txn_type = 'Churn' THEN 1 ELSE 0 END)
t_1.group_id
txn_date)) AS months
Date_order Start_Date Group_ID
1 1/1/2015 10902 4/1/2016 9554
1/1/2016 7878 4/1/2017 8892
2 1/1/2016 10090
3 4/1/2016 190290 We are not aware of the acquisition date for the above two customers
4 4/5/2016 19198 Acquisition Date - Date on which the customer subscribed for the first
5 1/1/2017 9823 Txn_type = "New" to know the Start_Date of customer
7 1/12/2018 2001
8 3/28/2018 118928
Purchase Cancellations
2015 1 0
2016 4 0
2017 1 1
2018 2 1
date for the above two customers
e customer subscribed for the first time,
know the Start_Date of customer
Insights
Group ID: 7878, 10090 were onboarded on the same day (1st Jan, 2016 and last transaction of both was also on same day (1s
This may be because both customer might have same parent company
Dashboard Creation
sualize the KPIs and the trends can be created at Executive Level
ality to perform deep dive analysis can be provided by creating
additional tabs in the dashboard
omoter - %Detractor
rage Monthy Customer Spent * Average Customer Lifespan
erage Transaction per Month