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.
| # | 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? |
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
| 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 |
- π° 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
pandas # Data manipulation & SQL-style queries
numpy # Numerical operations
matplotlib # Custom charts & dashboards
seaborn # Statistical visualizations
openpyxl # Excel report export# 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-- 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)
Eng. Heba | Data Analyst & Engineer
- π GitHub: @eng-heba-tech
- π§ eng.heba.tech@gmail.com
- π Egypt
β If you find this project useful, please give it a star!

