ketannnn/Retail-Sales-Intelligence-Dashboard
0
๐ Retail Sales Intelligence Dashboard
A complete Data Analyst portfolio project โ data cleaning, SQL analysis, EDA, and an interactive Streamlit dashboard built on the Superstore sales dataset.
๐ Problem Statement
A Superstore Giant is experiencing intense market competition and seeks data-driven guidance on:
- Which products, regions, categories and customer segments to prioritise or avoid
- How discount policies affect profitability
- Which shipping modes are most cost-effective
- Where consistent losses are occurring and why
๐ Dataset Description
Source: Sample โ Superstore public dataset (9,994 rows, 21 columns)
๐ ๏ธ Tools Used
๐๏ธ Project Structure
retail-sales-intelligence-dashboard/
โโโ data/
โ โโโ raw/
โ โ โโโ Sample - Superstore.csv
โ โโโ processed/ โ auto-generated at container start
โ โโโ cleaned_superstore.csv
โโโ .streamlit/
โ โโโ config.toml โ Streamlit server config for HF Spaces
โโโ notebooks/
โ โโโ 01_data_cleaning_and_eda.ipynb
โโโ sql/
โ โโโ business_queries.sql
โโโ src/
โ โโโ data_cleaning.py
โ โโโ database.py
โ โโโ analysis.py
โโโ dashboard/
โ โโโ app.py
โโโ Dockerfile โ HF Spaces Docker deployment
โโโ requirements.txt
โโโ README.md
โโโ .gitignoreโจ Key Features
- Automated Data Cleaning โ snake_case normalisation, datetime parsing, duplicate removal, safe null handling
- Feature Engineering โ
order_year,order_month,order_quarter,delivery_days,profit_margin,discount_range,is_profitable - SQLite Integration โ cleaned data stored in
retail_sales.dbfor SQL-based analysis - 10 SQL Business Queries โ KPIs, trends, region/category/segment/product analysis, discount impact, loss detection
- Interactive Dashboard โ 8 dashboard sections with 15+ Plotly charts, KPI cards, sidebar filters, and CSV export
- Dynamic Business Recommendations โ auto-generated insights from the filtered data
- Docker Deployment โ runs on Hugging Face Spaces via Docker SDK
๐ Dashboard Sections
๐ SQL Analysis Included
- Overall KPIs
- Monthly sales & profit trend
- Region-wise performance
- Category-wise performance
- Top 10 products by profit
- Bottom 10 products by profit (loss makers)
- Discount range impact on profit
- Ship mode performance
- Segment-wise performance
- Loss-making sub-categories
- Bonus: High-discount loss-making orders
๐ก Key Business Insights
- Technology generates the highest profit margin; Furniture is the weakest.
- Tables and Bookcases are consistent loss-makers, especially at high discounts.
- Discounts above 20% almost always result in losses across all categories.
- The West region is the top revenue driver; the Central region needs margin improvement.
- Standard Class accounts for ~60% of orders but has the longest delivery times.
- Corporate and Consumer segments dominate sales volume; Home Office is underserved.
๐ How to Run Locally
# 1. Clone the repo
git clone https://github.com/yourusername/retail-sales-intelligence-dashboard.git
cd retail-sales-intelligence-dashboard
# 2. Create and activate virtual environment
python -m venv venv
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Clean the raw data
python src/data_cleaning.py
# 5. Load into SQLite
python src/database.py
# 6. Launch the dashboard
streamlit run dashboard/app.py
# 7. (Optional) Open the Jupyter notebook
jupyter notebook notebooks/01_data_cleaning_and_eda.ipynb๐ณ Run with Docker
# Build the image
docker build -t retail-sales-dashboard .
# Run the container
docker run -p 8501:8501 retail-sales-dashboardThen open http://localhost:8501
๐ Resume Bullet Points
- Built an end-to-end retail sales analytics project in Python using Pandas, SQLite, and Streamlit, analysing 9,994 transactions across 4 regions and 17 product sub-categories
- Engineered 7 derived features (profit margin, delivery days, discount buckets) and automated data cleaning with encoding-safe CSV ingestion
- Authored 10 SQL business queries identifying recoverable losses from high-discount unprofitable orders
- Developed an interactive Streamlit dashboard with 15+ Plotly charts, dynamic KPI cards, sidebar filters, and a CSV export feature
- Containerised the application with Docker and deployed to Hugging Face Spaces for public access
๐ License
MIT โ free to use for portfolio and educational purposes.
