You are on page 1of 16

PHARMEASY –Assignment

PRIYANKA SINDHWANI
JANUARY, 14 2018

1
Objectives

• Provide an overview of the sales performance

• Define customer segmentation

• Forecast for well performing items

• Market basket Analysis

• Recommendations

• Syntax for SQL queries

2
About the Data

• Transactional line items with 148607 rows of data

• 22231 unique customers

• 382 customers with no flag for disease and non chronic

• Pincode were used to identify the states

• 3 months of data

3
Monetize users with repeated
Sales Overview purchase

o Avg. order per Customer is 7 % To p o r d e r e d I TE M S


18% 17%
16%
16%
o Avg. quantity per customer is 9 14%
14%
12%
10%
o 7 in 10 customers have more than 1 items in a 10%
8%
bucket
6%
4%
o 1 in 2 orders are for medicines antidiabetic, 2%
multivitamins, antihypertensive and 0%
Antidia
betic tamins tensive erlipide
mi c
Antihyperlipidemic Multivi Antihyp
er
A nti hyp

o 7 in 10 users have made repeated purchase Item in a bucket

o 1 in 2 seek medication for chronic disease


29% 30%
1 or 2
o More than 1 in 2 new user order medication for 3 to 4
5 to 7
non-chronic disease >7

o 62% of the purchase are for 1 quantity pack of 10


19%
22%

4
Align marketing campaign
Weekly trends with purchase days

o Strong upward trend in the data


o 8 in 10 sales are done on weekdays
o least orders are placed on Sunday
o Week 13 has a sharp spike in orders
o 38% more orders were placed in week 13,
when compared to previous week
o 63% increase in order “Antianginal” medication
o Erratic sales in daily order purchase

5
Need to tap into
Geographical trends potential market

90% 8.0 WEST BENGAL


80% 7.0 UTTAR PRADESH
70% 6.0
60% RAJASTHAN
5.0
50%
4.0 KARNATAKA
40%
3.0
30% GUJARAT
20% 2.0
1.0 DELHI
10%
0% 0.0 1
I T A H L k k2 k 3 k 4 k5 k 6 k 7 k 8 k9 10 11 12 13
LH RA AK T RA AN ES GA ee ee ee ee ee ee ee ee ee eek eek eek eek
DE JA AT SH TH AD N W W W W W W W W W W W W W
GU RN A AS PR BE
AR AJ ST
KA AH
R
T AR E
W
M UT DELHI GUJARAT KARNATAKA
RAJASTHAN UTTAR PRADESH WEST BENGAL
o 8 in 10 sales are from Maharashtra 70%

60%
o 2% of Users have also ordered for different cities
50%

o Delhi UP and Rajasthan have higher orders for non 40%

chronic disease 30%


Non Chronic
20% Chronic

o WB has highest orders per customer at 7.1 10%

0%
HI T KA A N H AL
o Sales in week 13 saw an uplift from Delhi DE
L
JA
RA TA SH
TR
ST
HA
AD
ES
EN
G
GU NA A JA PR B
KA
R AR RA R ES
T
AH TA W
M UT

6
Customer segmentation

Definition of segments
o 5X5 Segmentation grid defining recency and frequency
o 5 Macro segment MACROSEGMENT ROWS
>> Stars : Customers with high recency and frequency
more than 3 Stars 44|34|54|35|45|55
>> Potential Loyalist : High recency and frequency Potential Loyalist 32|42|52|33|43|53
between 2 and 3 New 31|41|51
>> New : High recency and frequency is equal to 1 Sliding 14|24|15|25
>> Sliding: Low on recency but frequency is
Hibernating 11|21|12|22|13|23
more than 3
>>Hibernating : Low on recency and frequency

7
Focus on potential loyalist
Segmentation Strategy and sliding

REACTIVATE NURTURE
frequency

HIBERNATING
17% STARS 28%
3k 6k

SLIDING Potential Loyalist 44%


9k
1%
251k
NEW 10%
2k
CHAMPION

recency
Week 1 Week 13

8
Monthly forecast for inventory
Inventory prediction management

Assumption: As only 13 data points to work with, therefore assumption that data has no trend or seasonality
Method Used : Single exponential forecasting method
Forecast : Top 12 selling products

Week 14
3000

2500

2000

1500

1000

500

0
s c ic cs ct l s
in eti si v
e
ni c id na tic nu ati
c
ai
d
m i ta du gi io lc o Ns
am ab n de
An
o
an
b am
vit tid
i rte pi am pr
An
ti yo th
ti pe rli ist a
An
ti s
ul An y
yp
e h rm M
tia
M tih An
ti
De An
An ntih
A

For detailed forecast methodology please follow the link here

9
Market Basket Analysis
Data Observations

o 285 transactions

o Multivitamin appeared 87 times, meaning 30% of


the transactions

o 2.9% are non-zero matrix cells

o Average transactions contain 2.06 items

o 128 transactions only contain a single item

10
Top Associations
Total of 121 rules generated

TOP 10 RULES
lhs rhs support confidence lift
[1] {Antianginal,Antihypertensive,Multivitamins} => {Ayurvedic product} 0.007017544 0.6666667 27.14286
[2] {Antifungal,Antihypertensive} => {Myoclonus} 0.007017544 0.6666667 17.27273
[3] {Antihypertensive,Ayurvedic product,Multivitamins} => {Antianginal} 0.007017544 1.0000000 14.25000
[4] {Antidiabetic,Antihypertensive,Derma product} => {Antianginal} 0.007017544 1.0000000 14.25000
[5] {Antidiabetic,Derma product,Multivitamins} => {Antianginal} 0.007017544 1.0000000 14.25000
[6] {Antidiabetic,Derma product} => {Antianginal} 0.010526316 0.7500000 10.68750
[7] {Antacid,Antihistaminics} => {Derma product} 0.007017544 1.0000000 10.17857
[8] {Antihypertensive,Ayurvedic product} => {Antianginal} 0.007017544 0.6666667 9.50000
[9] {Antibiotic,Antidiabetic} => {Antihistaminics} 0.007017544 1.0000000 9.50000
[10] {Antacid,Antibiotic} => {Antiasthamatic} 0.007017544 0.5000000 8.90625

>> The table above states the top 10 associations based on lift
>> This can be read as follows
eg : rule 10: Customer buying Antacid, Antibiotic is 8 times more likely to
buy Antiasthamatic than typical customer

11
Package discounts on meds brought
Valid Associations together

o Customer buying Antidiabetic medication


are 3 times more likely to buy Antianginal,
Antihypertensive and Multivitamin

o Rubifacient, Anthelmintic,
Antihyperlipidemic, Laxative and
Antidepresant are 3 times more likely to buy
Multivitamins

o Customer ordering
Antiasthamatic,Antihypertensive are 8 times
more likely to order Antacid lhs
Top 10 rules
rhs support confidence lift
[1] {Rubifacient} => {Multivitamins} 0.007017544 1 3.275862
[2] {Anthelmintic} => {Multivitamins} 0.007017544 1 3.275862
[3] {Antihyperlipidemic,Laxative} => {Multivitamins} 0.007017544 1 3.275862
[4] {Antidiabetic,Nsaid} => {Multivitamins} 0.007017544 1 3.275862
[5] {Antianginal,Ayurvedic product} => {Multivitamins} 0.007017544 1 3.275862
[6] {Antacid,Ayurvedic product} => {Multivitamins} 0.007017544 1 3.275862
[7] {Antidiabetic,Ayurvedic product} => {Multivitamins} 0.010526316 1 3.275862
[8] {Antihyperlipidemic,Antihypertensive,Laxative} => {Multivitamins} 0.007017544 1 3.275862
[9] {Antianginal,Antihypertensive,Ayurvedic product} => {Multivitamins} 0.007017544 1 3.275862
For all rules click here [10] {Antidepresant,Antidiabetic,Antihypertensive} => {Multivitamins} 0.007017544 1 3.275862

12
Recommendations

o Higher repeated purchase, therefore we need to have better offer to monetize


repeated purchase

o Declining over all trend, mainly because of decline sales in Maharashtra, need to monitor
sales decline

o Customers also place order for different cities, need to focus on customer experience to
increase loyalty

o Have continuous feedback and survey from hibernating and sliding customers

o Monthly forecast for inventory management

o Package items brought together

13
SQL syntax
Write a MySQL query that displays the customer_id, order_id, next order placed by the customer against
the same

// temp file is separate table created with data min order_id


- insert into temp select min(order_id), customer_id from order_new group by customer_id

SELECT
c.customer_id,
max(c.order_id),
max(c.or1)
FROM
(select order_id, 0 as or1, customer_id FROM temp
UNION ALL
select 0 as order_id, min(a.order_id) as or1, a.customer_id from order as a, temp b where a.customer_id =
b.customer_id and a.order_id <> b.order_id group by a.customer_id) as c
group by c.customer_id

14
SQL syntax
Write a MySQL query to determine the list of customers who placed orders with anti diabetic medicines in
the month of February from the cities where the number of orders placed has been greater than 2000 till
now
SELECT
customer_id,
count(order_id) as CountOrder,
State
FROM order
WHERE Date BETWEEN '2016-02-01' AND '2016-02-29' AND
disease_name = 'Antidiabetic'
GROUP BY customer_id
HAVING CountOrder > 2000;

15
THANK YOU

16

You might also like