Strategic Analysis of Sales and Profit Decline

This study examines a bicycle wholesaler's diminishing revenues from 2005 to 2008 using complex SQL queries and Tableau graphics. Key issues about sales trends, customer behavior, and regional performance are addressed, resulting in practical data for cost control, client retention, and marketing initiatives. Sales records, internal cost statistics, and detailed geographical performance are among the data sources used to provide a full picture of the company's health and potential for growth.
Live Project

Data Analytics Assignment

This project analyzes declining profits for a bicycle wholesaler by leveraging SQL for data manipulation and Tableau for data visualization. Using advanced data analytics techniques, the project uncovers the drivers behind profit decline from 2005 to 2008. The focus is on data cleaning, sales trends analysis, and customer behavior. The insights derived from this analysis provide strategic recommendations to improve cost control, boost customer retention, and enhance marketing efforts. By optimizing data-driven decisions, businesses can significantly improve their profitability and operational efficiency.

Objective of Data Analysis

The objective of this data analytics project is to identify key factors contributing to the profit decline between 2005 and 2008. Through data cleaning, SQL queries, and data visualization in Tableau, this analysis uncovers actionable insights into cost inefficiencies, customer behavior, and regional performance. The goal is to provide data-driven recommendations for improving profitability and driving business success by optimizing sales strategies, cost control, and marketing efforts. This approach ensures businesses can implement targeted solutions to enhance financial performance.

Key Questions Answered by the Dashboard:

  1. What are the sales and profit trends from 2005 to 2008?
    The Tableau dashboard visualizes monthly fluctuations in both sales and profits, highlighting peak and low-performing months. This provides clear insights into trends over time.
  2. Which regions and customers contributed the most to sales?
    The dashboard highlights top-performing regions and customer segments, enabling targeted, data-driven strategies for growth.
  3. Which products drove profitability, and which underperformed?
    By analyzing high and low-profit products, the dashboard helps optimize inventory management and marketing strategies for increased profitability.

Data Sources Used

  • Adventure Works Database:
    Sales data from 2005 to 2008, including customer, product, and regional sales details, was analyzed using SQL.
  • Tableau Visualizations:
    The dashboard visualized trends in sales, profit, and orders over time, providing insights into customer behavior and regional performance.
  • Internal Freight and Product Cost Data:
    This data helped analyze cost structures and profit margins to identify inefficiencies and profit-driving products.

Steps Taken For Analyzing Data

  • Data Collection:
    Sales data from 2005 to 2008, with missing data handled using MS Excel.
  • Data Cleaning & Transformation:
    SQL was employed to structure and refine the dataset.
  • Analysis:
    Sales trends, customer behavior, and regional performance were analyzed using SQL and visualized in Tableau.

Advanced SQL Queries for Business Data Analysis Success

Sales Trends Over Time

This analysis tracks sales, profit, and orders over months and years, using advanced SQL queries and data visualization in Tableau. It helps businesses understand how these key metrics fluctuate over time, identifying periods of high and low performance ( You can read more about how data analytics helps your business on my Blog). By visualizing these changes, businesses can make data-driven decisions to optimize profitability and improve operational efficiency. This approach provides clear insights into trends, enabling timely actions for maximizing growth opportunities while addressing performance issues.

SELECT 
    YEAR(OrderDate) AS Year, 
    MONTH(OrderDate) AS Month, 
    ROUND(SUM((UnitPrice * OrderQty) - (UnitPrice*UnitPriceDiscount*OrderQty)),2) AS Total_Sales, 
    ROUND(SUM(((UnitPrice - (UnitPrice * UnitPriceDiscount) - Unit_Cost) * OrderQty) - Unit_Freight_Cost),2) AS Total_Profit,
    SUM(OrderQty) AS Total_Orders
FROM 
    sales
GROUP BY 
    YEAR(OrderDate), MONTH(OrderDate)
ORDER BY 
    Year, Month;

Sales and Profit Trends: Total Metrics and Percent Change Overview

This SQL code is intended to track sales, profit, and orders over time, providing extensive information about monthly and annual patterns. Businesses can readily detect growth patterns or opportunities for improvement by computing percentage changes in each measure over the previous year. It's perfect for firms looking to improve their performance by examining swings in important financial metrics. This data-driven approach provides decision-makers with actionable information to help improve profitability and sales tactics.

WITH YearlyAggregates AS (
    SELECT 
        YEAR(OrderDate) AS Year, 
        MONTH(OrderDate) AS Month, 
        ROUND(SUM((UnitPrice * OrderQty) - (UnitPrice * UnitPriceDiscount * OrderQty)), 2) AS Total_Sales, 
        ROUND(SUM(((UnitPrice - (UnitPrice * UnitPriceDiscount) - Unit_Cost) * OrderQty) - Unit_Freight_Cost), 2) AS Total_Profit,
        SUM(OrderQty) AS Total_Orders
    FROM 
        sales
    GROUP BY 
        YEAR(OrderDate), MONTH(OrderDate)
)
SELECT 
    Year, 
    Month, 
    Total_Sales, 
    Total_Profit, 
    Total_Orders,
    
    -- Calculate the percentage difference in Total Sales from the same month in the previous year
    ROUND(
        (Total_Sales - LAG(Total_Sales) OVER (PARTITION BY Month ORDER BY Year)) / 
        LAG(Total_Sales) OVER (PARTITION BY Month ORDER BY Year) * 100, 2
    ) AS Percent_Change_Sales,
    
    -- Calculate the percentage difference in Total Profit from the same month in the previous year
    ROUND(
        (Total_Profit - LAG(Total_Profit) OVER (PARTITION BY Month ORDER BY Year)) / 
        LAG(Total_Profit) OVER (PARTITION BY Month ORDER BY Year) * 100, 2
    ) AS Percent_Change_Profit,
    
    -- Calculate the percentage difference in Total Orders from the same month in the previous year
    ROUND(
        (Total_Orders - LAG(Total_Orders) OVER (PARTITION BY Month ORDER BY Year)) / 
        LAG(Total_Orders) OVER (PARTITION BY Month ORDER BY Year) * 100, 2
    ) AS Percent_Change_Orders
FROM 
    YearlyAggregates
ORDER BY 
    Year, Month;

Regional Sales and Profit Performance

This SQL query calculates total sales, profit, and order volume by sales region, assisting organizations in identifying their best-performing locations. By categorizing data by location and calculating total sales and profit, this analysis identifies the most profitable areas and enables targeted decision-making. Sorting the findings by total revenue in descending order reveals where the company is thriving and where additional marketing or operational efforts are needed to drive development. Ideal for optimizing regional plans and increasing profits.

SELECT 
    Sales_Region, 
    SUM((UnitPrice * OrderQty) - (UnitPrice*UnitPriceDiscount*OrderQty)) AS Total_Sales, 
    SUM(((UnitPrice - Unit_Cost) * OrderQty) - Unit_Freight_Cost) AS Total_Profit, 
    SUM(OrderQty) AS Total_Orders
FROM 
    sales
GROUP BY 
    Sales_Region
ORDER BY 
    Total_Sales DESC;

Customer Purchase Behaviour

Explanation:

This SQL query computes total sales for each client and groups the results by customer name. It enables organizations to identify their top consumers based on sales volume, which is useful for segmenting high-value customers for tailored marketing or loyalty programs. By rounding the sales values and sorting the results in decreasing order, this query clearly identifies the most significant customers in terms of revenue creation, allowing data-driven strategies to maximise client retention and growth.

SELECT 
    Customer_Name,
    ROUND(SUM((UnitPrice * OrderQty) - (UnitPrice * UnitPriceDiscount * OrderQty)),2) AS Total_Sales
FROM 
    sales
GROUP BY 
    Customer_Name
ORDER BY 
    Total_Sales DESC;


If you wish to see the full MySQL code click HERE.

SQL code used in this data analytics project, which includes advanced techniques for data cleansing, modification, and performance tracking. Discover how SQL may provide valuable insights into sales, consumer behavior, and regional success. This code is critical for stakeholders trying to optimize their data-driven initiatives with precision.

Data Insights

  • Sales and Profit Trends:
    While sales and orders increased over time, profit margins fluctuated, particularly a significant drop of 42% in May 2008.
    The Tableau dashboard visualizes these trends, highlighting key periods of fluctuation.
  • Margin Analysis:
    Profit margins dropped consistently between 2005 and 2008, despite efforts to reduce freight costs in 2008.
    Tableau visualizations revealed inefficiencies in cost control, as costs rose faster than revenues, contributing to shrinking margins.
  • Customer and Regional Insights:
    18.26% of customers stopped purchasing in 2008, while top regions like California and Washington showed consistent growth.
    International markets, particularly in France, contributed to significant sales, while some states underperformed.
  • Product Performance:
    Top-performing products and regions were identified through SQL queries, showing high-profit contributors and low-performing categories that need improvement.

How Data Analytics Can Drive Business Success

  • Cost Control
    Accurate cost management through data-driven analysis is key to improving profit margins.

    Actionable Example
    • Analyze the supplier costs and renegotiate contracts, as freight costs were reduced in 2008. If applied consistently, profit margins could stabilize or grow by up to 5%, helping reverse the downward trend seen between 2005 and 2008.
    • Use visualizations to track cost increases and adjust pricing accordingly. With rising costs from 2007 to 2008, if pricing aligned with cost changes, the projected profit margin could improve by 10-15%.

  • Customer Retention
    Customer re-engagement and market expansion can drive significant sales growth.

    Actionable Example
    • Implement loyalty programs for customers who cut purchases in 2008, where 18.26% of customers stopped buying. By offering targeted promotions, you could retain up to 50% of these customers, resulting in an estimated revenue increase of 7-10%.
    • Focus on growing international markets like France, which contributed $2M in sales. By localizing marketing strategies, potential sales could increase by 15-20% in underperforming regions.

  • Marketing Focus
    Utilize data insights to drive targeted marketing and boost growth.

    Actionable Example
    • Increase marketing efforts in California, Washington, and Texas, which are top performers. With targeted campaigns, you could see a 10-12% increase in revenue from these regions.
    • Re-engage low-performing regions like Rhode Island and Montana through localized promotions. A modest improvement of 5% in these regions could result in a notable boost to overall sales.

Related Data-Driven Projects:

Have a Project in Mind? Let’s Collaborate and Bring It to Life

Embark on a journey where creativity meets precision, turning your design visions into dynamic realities.