CRPC9 Presentation
CRPC9 Presentation
Presented by:
Gerald Simanullang
Table of Content
1 Introduction to AtliQ Mart
5 Business Request
Data
Objective of the Project
Step 3
Give recommendations of promotion strategies for
next period of promotions, based on the analysis.
Step 2
Visualize, analyze and present insights to Sales
Director. (Dashboard with Power BI)
Step 1
Write SQL queries to generate report that answers
5 business questions posed by Senior Executives.
Overview of the Dataset
fact_events dim_stores
event_id store_id
dim_campaigns store_id city
campaign_id campaign_id
campaign_name product_code dim_products
start_date base_price product_code
end_date promo_type product_name
quantity_sold(before_promo category
)
quantity_sold(after_promo)
1. Business Request
Write SQL queries to generate report that answers
5 business questions posed by Senior Executives.
Business Request 1
Provide a list of products with a base price greater than 500 and that are featured in promo type of ‘BOGOF’.
This information will help us identify high-value products that are currently being heavily discounted, which can be useful for evaluat -
ing our pricing and promotion strategies.
USE retail_events_db;
-- 1. Products with a base price greater than 500 that have a 'buy one get one free' (BOGOF) promotion
SELECT DISTINCT
fe.product_code AS 'Product Code',
dp.product_name AS 'Product Name',
fe.base_price AS 'Base Price (₹)',
fe.promo_type AS 'Promo Type’
FROM fact_events AS fe
INNER JOIN dim_products AS dp ON fe.product_code = dp.product_code
WHERE fe.promo_type = 'BOGOF' AND fe.base_price > 500
ORDER BY fe.base_price DESC;
Output:
Business Request 2
Generate a report that provides an overview of the number of stores in each city. The results will be sorted in descending order of store
counts, allowing us to identify the cities with the highest store presence. The report includes two essential fields: city and store count,
which will assist in optimizing our retail operations.
Output:
Business Request 3
Generate a report that displays each campaign along with the total revenue generated before and after the campaign. The report
includes three key fields: campaign_name, total_revenue(before_promotion), total_revenue(after_promotion). This report should help
in evaluating the financial impact of our promotional campaigns (Display the values in millions)
500 Cashback:
₹500
Cashback
BOGOF:
BOGOF
“Buy one get one free”
Business Request 3
Generate a report that displays each campaign along with the total revenue generated before and after the campaign? The report
includes three key fields: campaign_name, total_revenue(before_promotion), total_revenue(after_promotion). This report should help
in evaluating the financial impact of our promotional campaigns (Display the values in millions)
• The values of quantity after promo are NOT INCLUDING the bonus. We could simply knew this because many of the
quantity after promo are not in even number. It means we’re NOT dividing the quantity by 2.
• Because this promo type sacrifices the cost of one product, and we don’t have the data of product cost, we CAN’T make
any decrement to the price,
Based on the logic above, the revenue formula for BOGOF is just the base price multiplied by quantity sold after promo.
Business Request 3
Generate a report that displays each campaign along with the total revenue generated before and after the campaign? The report
includes three key fields: campaign_name, total_revenue(before_promotion), total_revenue(after_promotion). This report should help
in evaluating the financial impact of our promotional campaigns (Display the values in millions)
82.6M
Output:
58.1M
Diwali Sankranti
Business Request 4
Produce a report that calculates the Incremental Sold Quantity (ISU%) for each category during the Diwali Campaign. Additionally,
provide rankings for the categories based on their ISU%. The report will include three key fields: category, isu%, and rank order.
This information will assist in assessing the category-wise success and impact of the Diwali campaign on incremental Sales.
-- 4. Incremental Sold Quantity (ISU%) of each category during the Diwali campaign
SELECT
DENSE_RANK() OVER (ORDER BY isu_pct DESC) AS 'Rank',
ctgy AS 'Category',
isu_pct AS 'ISU (%)',
SUM(qty_before) AS 'Quantity Before Promotion',
SUM(qty_after) AS 'Quantity After Promotion’
FROM (
SELECT
dp.category AS ctgy,
SUM(fe.`quantity_sold(before_promo)`) AS qty_before,
SUM(fe.`quantity_sold(after_promo)`) AS qty_after,
SUM((fe.`quantity_sold(after_promo)` - fe.`quantity_sold(before_promo)`))
/ SUM(fe.`quantity_sold(before_promo)`) * 100 AS isu_pct
FROM fact_events AS fe
INNER JOIN dim_campaigns AS dc ON fe.campaign_id = dc.campaign_id
INNER JOIN dim_products AS dp ON fe.product_code = dp.product_code
WHERE dc.campaign_name = 'Diwali'
GROUP BY dp.category
) AS isu_calc
GROUP BY ctgy;
Business Request 4
Produce a report that calculates the Incremental Sold Quantity (ISU%) for each category during the Diwali Campaign. Additionally,
provide rankings for the categories based on their ISU%. The report will include three key fields: category, isu%, and rank order.
This information will assist in assessing the category-wise success and impact of the Diwali campaign on incremental Sales.
Output:
Business Request 5
Create a report featuring the Top 5 products, ranked by Incremental Revenue percentage (IR%), across all campaigns. The report will
provide essential identify the most successful products in terms of incremental revenue across our campaigns, assisting in product
optimization.
-- 5. Top 5 products with their category, ranked by Incremental Revenue Percentage (IR%)
SELECT
DENSE_RANK() OVER(ORDER BY ir_calc.ir DESC) AS 'Rank',
dp.product_name AS 'Product Name',
dp.category AS 'Category',
ir_calc.ir AS 'IR (%)',
ir_calc.total_rev_before / 1000000 AS 'Total Revenue Before Promotion (million ₹)',
ir_calc.total_rev_after / 1000000 AS 'Total Revenue After Promotion (million ₹)’
FROM (
SELECT
product_code,
((SUM(rev_after_promo) - SUM(rev_before_promo)) / SUM(rev_before_promo) * 100) AS ir,
SUM(rev_before_promo) AS total_rev_before,
SUM(rev_after_promo) AS total_rev_after
FROM (
SELECT
*,
base_price * `quantity_sold(before_promo)` AS rev_before_promo,
CASE
WHEN promo_type = '50% OFF' THEN (base_price * `quantity_sold(after_promo)` * (1 - 0.5))
WHEN promo_type = '33% OFF' THEN (base_price * `quantity_sold(after_promo)` * (1 - 0.33))
WHEN promo_type = '25% OFF' THEN (base_price * `quantity_sold(after_promo)` * (1 - 0.25))
WHEN promo_type = '500 Cashback' THEN ((base_price - 500) * `quantity_sold(after_promo)`)
WHEN promo_type = 'BOGOF' THEN (base_price * `quantity_sold(after_promo)` * (1 - 0.5))
END AS rev_after_promo
FROM fact_events
) AS rev_calc
GROUP BY product_code
) AS ir_calc
INNER JOIN dim_products AS dp ON ir_calc.product_code = dp.product_code
ORDER BY ir_calc.ir DESC
LIMIT 5;
Business Request 5
Create a report featuring the Top 5 products, ranked by Incremental Revenue percentage (IR%), across all campaigns. The report will
provide essential identify the most successful products in terms of incremental revenue across our campaigns, assisting in product
optimization.
Output:
2. Visualization, Analysis and Insights
Visualize, analyze and present insights to Sales Direc-
tor. (Dashboard with Power BI)
Visualization Dashboard
https://shorturl.at/xEHX9
Campaigns Overall
Campaigns Revenue Growth:
• Both campaigns succeeded in boosting overall revenue to more than twice the revenue before the promotions. The
Diwali campaign achieved a revenue growth of 107.6%, while the Sankranti campaign scored an impressive 113.6%.
• However, the revenue-increasing events for both campaigns were below 50%, indicating that there were more failed
events than successful ones. The percentage of successful events during the Diwali campaign was only 39.1%, and
for Sankranti, it was 48.7%.
• All the stores were succeeded to increase their revenue. Store STCHE-7 from Chennai came out with the highest
revenue growth at 142.7%, and the lowest was store STMYS-0 from Mysuru at 67.4% revenue growth.
• The Madurai city came out with the highest average of revenue growth which was 120% from their 4 stores. All of
their stores grew their revenue above 100%. The highest was store STMDU-0 with 139.2% revenue growth (rank 5
from all stores), and the lowest was STMDU-3 with 109.2% revenue growth.
• Lowest average of revenue growth came from Visakhapatnam city with score 94.4% from their 5 stores. The best-per-
forming store from there was STVSK-0 with 112.7% revenue growth, and the least-performing store was STVSK-3
with 69.5% revenue growth (rank 49 from all stores).
• There were distinctive characteristics of the top 10 stores by revenue growth. First, their revenue growth exceeded
130% (the 11th place had 117.3%). Second, their BOGOF promotions worked exceptionally well and increased rev-
enue by more than 300% (which means four times the previous amount).
• The bottom 10 stores by revenue and sold-unit growth were the same stores. Their characteristic were revenue and
sold-unit growth uptick stayed below 100%, indicating progress but not surpassing twice the previous amount. Like
the top 10 stores, they also engaged in BOGOF promotions. Although effective, these promotions couldn't quite
match the prowess of the better-performing stores, scoring below the 200% threshold.
Promotion Type Analysis
25% Discount:
• The 25% discount never worked. Each campaign had 200 events of this promo type and not a single event suc-
ceeded to increase the sales.
• In aggregation of both campaigns, this promo type decreased the number of units sold by 13% and decreased the
revenue by 34.6%.
33% Discount:
• The 33% discount always increased the number of units sold, but sometimes failed to increase the revenue.
• Each campaign had 100 events of this promo type, in Diwali 43 events increased the revenue and in Sankranti only
15 events did.
• In aggregation, this promo type increased the Sold-unit by 43% but decreased the revenue by 4.3%.
• This promo was only applied to product P01 and P02 in both campaign.
50% Discount:
• The 50% discount also always increased the number of unit sold, but never succeeded to increase revenue.
• During Diwali there were 200 events of this promo type and during Sankranti there were 100 events.
• This promo type increased the number of unit-sold by 32.6% but decreased the revenue by 33.6% in aggregation.
Promotion Type Analysis
₹ 500 Cashback:
• This promo type always succeeded to increase sold-unit and revenue significantly especially in Diwali campaign with
sold-unit increase at 202.4%. During Sankrati campaign, it grew the units sold by 125.3%.
• It was only applied to Home Essential 8 Product Combo (P15) which has base price ₹3000. It means this promo was
equal to 16.67% discount.
BOGOF:
• Like the cashback promo, this promo also always succeeded to increase the number of sold-unit. It was applied more
in Sankrati campaign (300 events) than Diwali (200 events). This is the reason why Sankrati campaign grew the sold-
unit more than Diwali campaign.
• It was applied to P07, P08, P13, P14 both campaign, and was applied to P03 and P04 only in Sankranti campaign.
Product & Category Analysis
Grocery & Staples Category (P01, P02, P03 and P04)
• This category in fact is the most buy category. Its sold-unit before promotion are always the highest with total 58.1K
sales before Diwali and 68.8K before Sankranti.
• However, during Diwali promotions, this category was featured with wrong promotion types, especially for Sunflower
Oil product (P03) and Farm Chakki Atta product (P04). Both of those products were featuring the ‘25% discount’
which made P03’s sold-unit decreased by 33.8% and P04’s sold-unit decreased by 34.2%.
• Seems like learning from experience, P03 and P04 changed the promotion types for the Sankranti campaign to ‘BO -
GOF’ promotion type and made an exceptional sold-unit growth. The result were: P03 sales increased by 276.4% and
P04 sales increased by 275.1%.
• Meanwhile, Masoor Dal product (P01) and Sonamasuri Rice product (P02) didn’t make any change of promotion type
during both campaign which was ‘33% discount’. The Sold-unit were always increased around 47% during Diwali and
39% during Sankranti, but the revenue always decreased around 1% during Diwali and 7% during Sankranti.
Product & Category Analysis
Home Care Category (P05, P06, P07 and P08)
• P05 and P06 were always featured with ‘25% discount’ promo, and always decreased the number of units sold.
• Meanwhile, P07 and P08 were always featured with ‘BOGOF’’ promo, and always massively increased the number of
units sold.
• Based on the quantity before promo, the demand of this category was more than two times higher in Diwali (13.3K)
compared to Sankranti (6.4K)
• However, the growth in units sold in Sankranti (162.4%) was more than two times higher compared to Diwali (79.6%)
Do not create the '25% discount' promotion type anymore, as it appears uninteresting to customers. Similarly,
do not offer the '50% discount' promotion. Although '50%' may sound appealing, in reality, the '33% discount’
has proven to result in a greater increase in sold units.
Focus on boosting the sales of products with low demand and high inventory levels especially products in
Home Care and Personal Care categories, which had lowest number of units sold before promotion. If the
profit margin is above 100%, implement the 'BOGOF' (Buy One, Get One Free) promotion. For profit margins
between 33% and 100%, consider using the '33% discount' promotion.
Explore the creation of new product combinations and use cashback promotions. While product combos
based on categories is a possibility, conducting an analysis using Association Rules would be beneficial.
This analysis helps identify products that are commonly purchased together, if we have sales receipt data.
Special Thanks
Dhaval Patel
Founder of Codebasics
linkedin.com/in/dhavalsays
Hemanand Vadivel
Co-Founder of Codebasics
linkedin.com/in/hemvad