Skip to content

eng-heba-tech/Retail-Sales-Analytics-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ Retail Sales Analytics Dashboard (2022–2023)

Python Pandas Matplotlib SQL Status


πŸ“Œ Project Overview

A full end-to-end Business & Sales Analytics project that simulates a real Egyptian retail company with 2,000 transactions over 2 years. The goal is to extract actionable insights from sales data using Python, SQL-style queries, and interactive visualizations.


🎯 Business Questions Answered

# Question
1 Which product category generates the most revenue?
2 What is the monthly revenue trend over 2 years?
3 Which region has the highest sales volume?
4 Who is the top-performing sales representative?
5 How does discount level affect average order value?
6 What is the most popular payment method?
7 What is the quarterly revenue trend per category?
8 How does customer satisfaction correlate with order value?

πŸ“Š Dashboard Preview

Overview Dashboard

Dashboard Overview

Deep-Dive Analysis

Deep Dive


πŸ“ Project Structure

Retail-Sales-Analytics/
β”‚
β”œβ”€β”€ πŸ“„ sales_data.csv            # Raw dataset (2,000 transactions)
β”œβ”€β”€ 🐍 generate_data.py          # Data generation script
β”œβ”€β”€ 🐍 analysis.py               # Full EDA + SQL-style analysis
β”œβ”€β”€ πŸ“Š dashboard_overview.png    # Main KPI dashboard
β”œβ”€β”€ πŸ“Š deep_dive_analysis.png    # Correlation & trend analysis
β”œβ”€β”€ πŸ“‹ analysis_summary.xlsx     # Excel report (3 sheets)
└── πŸ“– README.md

πŸ“¦ Dataset Description

Column Type Description
Order_ID String Unique order identifier
Date Date Transaction date (2022–2023)
Category String Product category (5 categories)
Region String Egyptian city
Sales_Rep String Representative name
Quantity Integer Units sold
Unit_Price Float Price per unit ($)
Discount Float Discount applied (0–20%)
Total_Sales Float Net revenue after discount
Payment_Method String Payment type
Customer_Age Integer Customer age
Customer_Satisfaction Integer Rating 1–5

πŸ” Key Findings

  • πŸ’° Electronics is the highest-revenue category (~30% of total sales)
  • πŸ“ˆ Revenue shows a positive growth trend in Q4 2023
  • πŸ—ΊοΈ Cairo leads in total regional revenue
  • πŸ‘€ Nour Ibrahim is the top sales representative ($2.06M)
  • πŸ’³ Credit Card is the most preferred payment method
  • 🏷️ Orders with 10–15% discount show the highest average order value
  • 😊 Customer satisfaction score doesn't strongly predict order size β€” suggesting pricing is needs-driven

πŸ› οΈ Technologies Used

pandas       # Data manipulation & SQL-style queries
numpy        # Numerical operations
matplotlib   # Custom charts & dashboards
seaborn      # Statistical visualizations
openpyxl     # Excel report export

▢️ How to Run

# 1. Clone the repository
git clone https://github.com/eng-heba-tech/Retail-Sales-Analytics
cd Retail-Sales-Analytics

# 2. Install dependencies
pip install pandas numpy matplotlib seaborn openpyxl

# 3. Generate dataset
python generate_data.py

# 4. Run full analysis
python analysis.py

πŸ“ˆ SQL-Style Queries Performed

-- Monthly Revenue Growth
SELECT Month, SUM(Total_Sales) AS Revenue,
       LAG(Revenue) OVER (ORDER BY Month) AS Prev_Month,
       ((Revenue - Prev_Month) / Prev_Month * 100) AS Growth_Pct
FROM sales_data GROUP BY Month;

-- Top Sales Representatives
SELECT Sales_Rep,
       SUM(Total_Sales) AS Total_Revenue,
       AVG(Total_Sales) AS Avg_Order,
       COUNT(Order_ID)  AS Total_Orders
FROM sales_data GROUP BY Sales_Rep ORDER BY Total_Revenue DESC;

-- Category Performance by Region
SELECT Category, Region, SUM(Total_Sales)
FROM sales_data GROUP BY Category, Region;

(Implemented using pandas groupby β€” equivalent to SQL)


πŸ‘©β€πŸ’» Author

Eng. Heba | Data Analyst & Engineer


⭐ If you find this project useful, please give it a star!

About

πŸ“Š End-to-end sales analysis for 2,000+ retail transactions | Python β€’ Pandas β€’ SQL β€’ Matplotlib | KPI Dashboard, Trend Analysis & Excel Report

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages