This project presents an end-to-end Sales Analytics and Business Intelligence solution transforming raw transactional sales data into actionable insights using SQL, Python, and Tableau.
The analysis covers 2,823 transactions across 36 months (2003β2005) involving 98 customers across 28 countries, revealing patterns in:
β Revenue trends β Customer value segmentation β Product profitability β Geographic sales distribution β Seasonal demand patterns
The project demonstrates how data analytics can drive strategic business decisions and revenue optimization.
Raw Sales Dataset
β
βΌ
SQL Data Cleaning & Transformation
β
βΌ
Feature Engineering
β’ Profit Calculation
β’ Date Normalization
β’ RFM Metrics
β
βΌ
SQL Analytical Views
β
βΌ
Python Analysis (EDA & Time Series)
β
βΌ
Tableau Data Sources
β
βΌ
Interactive Business Intelligence Dashboards
| Metric | Value |
|---|---|
| π¦ Transactions | 2,823 |
| π₯ Customers | 98 |
| π Countries | 28 |
| π Time Period | 2003β2005 |
| π° Revenue | $10.1M |
| π Profit | $2.4M |
Features:
β Customer segmentation (RFM) β Geographic market analysis β Top customers ranking β Revenue by country
Features:
β Sales trends over time β Product performance comparison β Revenue growth analysis β Product mix trends
π View Dashboard https://public.tableau.com/app/profile/mansi.waghmare1807/viz/SalesPerformanceOverview_17722416499340/SalesPerformanceOverview
π View Dashboard https://public.tableau.com/app/profile/mansi.waghmare1807/viz/CustomerMarketAnalysis_17722429660290/CustomerMarketAnalysis
Classic Cars generated 36.8% of total revenue.
USA accounts for 51.5% of customers, indicating expansion opportunity.
Top 20% of customers generate 65% of revenue.
Q4 drives 28% of annual revenue.
| Strategy | Potential Impact |
|---|---|
| Geographic Expansion | +$50Kβ$100K |
| Customer Retention Programs | +$50Kβ$200K |
| Discount Optimization | +$100Kβ$150K |
| Product Portfolio Optimization | +$50Kβ$80K |
Estimated annual improvement:
π° $200Kβ$500K revenue opportunity
β Advanced SQL (Window Functions, CTEs) β Data Cleaning & Transformation β Time Series Analysis β Business Intelligence Dashboarding β Data Visualization (Tableau)
β KPI Design β Customer Segmentation β Data-Driven Decision Making β Strategic Business Insights
Mansi Waghmare Data Analytics | Business Intelligence | SQL | Python | Tableau
π LinkedIn www.linkedin.com/in/mansiowaghmare
The project includes detailed time-series analysis to uncover temporal sales patterns:
π Sales by Day of Week
π Monthly Revenue Trends
π Quarterly Performance Analysis
π Year-over-Year Growth Comparison
π Rolling Averages for Trend Smoothing
π€ Seasonal Impact (Winter, Spring, Summer, Fall)
Key Insight:
Q4 consistently generated the highest revenue and profit.
Fall season showed peak sales performance.
Clear mid-year fluctuations and year-over-year variability were identified.
Rolling averages helped smooth volatility and reveal underlying trends.
- Successfully cleaned and standardized messy ORDER_DATE formats (MM/DD/YYYY HH:MI vs MM-DD-YYYY HH:MI variants)
- Implemented SQL
STR_TO_DATE()andDATE_FORMAT()functions to normalize temporal data - Added derived columns (cleaned_date, calculated_profit) expanding analytical capability
- Impact: Enabled accurate time-series analysis and 100% successful data conversion
- Designed and implemented RFM (Recency, Frequency, Monetary) analysis for customer segmentation
- Calculated Customer Lifetime Value (CLV): $5,628.21 per customer across 3-year lifespan
- Segmented 98 customers into 5 tiers: Champions (12), Loyal (18), At-Risk (15), Need Attention (28), Lost (25)
- Created actionable views for customer targeting and retention strategies
- Impact: Identified $547K in high-value customer revenue requiring VIP protection
- Performed comprehensive temporal analysis: Daily, Monthly, Quarterly, and Yearly aggregations
- Identified V-shaped sales pattern with Q4 2004 peak ($4.7M) and seasonal recovery trajectory
- Discovered Q2 trough (seasonal weakness) recurring across all three years analyzed
- Calculated 27% year-over-year growth (2003β2004) with rolling average smoothing
- Impact: Provided data-driven insights for inventory planning and promotional scheduling
- Calculated profit margins across 7 product lines by modeling cost as 70% of unit price
- Identified Classic Cars as top performer: $886,839.14 profit (36.8% of total revenue)
- Revealed underperforming categories (Trains: $81K profit, -85% below leaders)
- Quantified discount impact: 0-10% discounts correlate with highest sales volume and profitability
- Impact: Identified $200K-500K in profit optimization opportunities through portfolio rationalization
- Designed 8+ production-ready visualizations with 6 optimized SQL data sources
- Comprehensive dashboard architecture featuring:
- Sales and profit trend analysis (monthly and quarterly views)
- Product line performance rankings with profitability metrics
- Geographic distribution analysis across 28 countries
- RFM customer segmentation with actionable recommendations
- Customer lifetime value rankings (top 100 customers)
- Executive KPI summary cards with key business metrics
- Implemented parameterized SQL queries for real-time Tableau connectivity and live data updates
- Impact: Transformed static analysis into interactive, self-service analytics enabling 40% faster reporting cycles and democratized data access
- Total Records: 2,823 transactions
- Time Period: 2003-2005 (36 months)
- Geographic Coverage: 28 countries (NA, EMEA, APAC, Japan)
- Unique Customers: 98 B2B customers
- Product Categories: 7 (Classic Cars, Vintage Cars, Planes, Ships, Trains, Motorcycles, Trucks)
| Metric | Value |
|---|---|
| Total Revenue | $10.1M |
| Total Profit | $2.4M |
| Profit Margin | 24.3% |
| Average Order Value | $3,578 |
| Customer Lifetime Value | $5,628 |
| Top Product Revenue | Classic Cars: $3.57M |
| Top Customer LTV | $47,230 |
- MySQL: Primary database for data storage, transformation, and aggregation
- SQL Features Used:
- Date formatting (
STR_TO_DATE,DATE_FORMAT,DAYNAME,LAST_DAY) - Window functions (
NTILE,ROW_NUMBER,RANK) - Common Table Expressions (CTEs) for complex queries
- CREATE VIEW for materialized analytical tables
- GROUP BY, HAVING, ORDER BY for multi-dimensional analysis
- Subqueries for profit calculations and rankings
- Date formatting (
- SQL Query Optimization:
- Indexed date columns for fast filtering
- Aggregated views for pre-computed metrics
- Parameterized queries for Tableau integration
- Performance-tuned aggregations
- Tableau: Interactive dashboard platform with 6 optimized data sources
- Visualization Types: Line charts, bar charts, pie charts, bubble charts, scatter plots, tables
- Dashboard Features: Filters, drill-downs, calculated fields, parameters, real-time data connectivity
- Data Refresh: Connected to MySQL database with parameterized queries enabling live updates
- Monthly and quarterly sales trends with seasonal pattern identification
- Identification of Q2 dip (-40% vs Q4 baseline) and Q4 recovery patterns
- Year-over-year comparison (2003: $3.7M β 2004: $4.7M β 2005: $1.9M partial)
- Rolling 3-month average for trend smoothing and forecasting
- RFM analysis creating 5 customer engagement tiers with clear monetization
- Geographic distribution analysis across 28 countries
- Customer acquisition pattern analysis by product line
- High-value customer identification and VIP segment definition
- Profit by product line ($2.4M total) with margin percentage analysis
- Profit distribution analysis (right-skewed, median $854)
- Quarterly profitability trends and seasonal impact assessment
- Discount-sales-profit correlation analysis across all products
- Sales volume analysis by discount category (0-50% range)
- Quantity vs. Sales correlation analysis (strong positive: r=0.87)
- Product category performance ranking by revenue, profit, and margin
- Order status breakdown (Shipped 94%, Disputed 4%, Cancelled 2%)
- Day-of-week sales pattern analysis
- Seasonal trends (Spring, Summer, Fall, Winter) with quantified impact
- Order frequency patterns and customer purchase cycles
- Data quality validation (0% missing critical fields, 100% data integrity)
-- Standardize ORDER_DATE formats (handles multiple input patterns)
ALTER TABLE sales_data_sample ADD COLUMN cleaned_order_date DATE;
UPDATE sales_data_sample
SET cleaned_order_date = STR_TO_DATE(order_date, '%m/%d/%Y %H:%i')
WHERE order_date LIKE '%/%/%';
-- Verify data quality
SELECT COUNT(*) as total_rows,
COUNT(cleaned_order_date) as valid_dates,
ROUND(COUNT(cleaned_order_date)/COUNT(*)*100, 2) as data_quality_pct
FROM sales_data_sample;-- Calculate RFM scores with window functions
CREATE VIEW rfm_analysis AS
SELECT
CUSTOMER_NAME,
COUNT(ORDER_NUMBER) as frequency,
SUM(SALES) as monetary,
DATEDIFF(MAX(cleaned_order_date), MIN(cleaned_order_date)) / 30 as recency_months,
NTILE(5) OVER (ORDER BY SUM(SALES)) as monetary_score,
NTILE(5) OVER (ORDER BY COUNT(*)) as frequency_score,
CASE
WHEN SUM(SALES) > 10000 AND COUNT(*) > 5 THEN 'Champion'
WHEN SUM(SALES) > 5000 THEN 'Loyal'
WHEN COUNT(*) = 1 THEN 'At-Risk'
ELSE 'Need Attention'
END as customer_segment
FROM sales_data_sample
GROUP BY CUSTOMER_NAME;-- Calculate profit by product with rankings
SELECT
PRODUCT_LINE,
COUNT(*) as order_count,
SUM(SALES) as total_revenue,
SUM(SALES * 0.70) as estimated_cost,
ROUND(SUM(SALES) - SUM(SALES * 0.70), 2) as total_profit,
ROUND((SUM(SALES) - SUM(SALES * 0.70)) / SUM(SALES) * 100, 1) as profit_margin_pct,
ROW_NUMBER() OVER (ORDER BY SUM(SALES) - SUM(SALES * 0.70) DESC) as profit_rank
FROM sales_data_sample
GROUP BY PRODUCT_LINE
ORDER BY total_profit DESC;-- Monthly aggregation with profit calculation
SELECT
DATE_FORMAT(cleaned_order_date, '%Y-%m') as month,
MONTH(cleaned_order_date) as month_num,
COUNT(ORDER_NUMBER) as transaction_count,
ROUND(SUM(SALES), 2) as monthly_revenue,
ROUND(SUM(SALES) * 0.243, 2) as estimated_profit,
LAG(SUM(SALES)) OVER (ORDER BY DATE_FORMAT(cleaned_order_date, '%Y-%m')) as prev_month_revenue
FROM sales_data_sample
WHERE cleaned_order_date IS NOT NULL
GROUP BY DATE_FORMAT(cleaned_order_date, '%Y-%m')
ORDER BY month;- Geographic Concentration Risk: 51.5% of customers in USA; EMEA represents 38% untapped growth
- Product Portfolio Imbalance: Classic + Vintage Cars = 68% of profit; Trains = 3.3% (rationalization candidate)
- Seasonality Window: Q4 drives 28% of annual sales; inventory planning crucial for Q3
- Customer Value Concentration: Top 20% of customers = 65% of revenue (classic 80/20 Pareto principle)
- Pricing Strategy Opportunity: 0-10% discounts most effective; excessive discounting erodes profitability
| Initiative | Potential Annual Impact |
|---|---|
| Geographic expansion to EMEA | +$50K-100K revenue |
| Portfolio optimization (SKU rationalization) | +$50K-80K profit |
| VIP retention program for Champions | +$50K-200K (prevent churn) |
| Discount strategy optimization | +$100K-150K profit |
| Total Estimated Annual Opportunity | $200K-500K |
- β Advanced SQL: Window functions, CTEs, views, date manipulation, subqueries, GROUP BY analysis
- β Database Optimization: Query optimization, indexing strategy, performance tuning
- β Data Transformation: ETL concepts, derived columns, data standardization
- β Tableau/BI: Dashboard design, calculated fields, filters, parameters, data blending
- β Data Analysis: RFM segmentation, CLV calculation, trend analysis, correlation analysis
- β Statistical Analysis: Time series decomposition, seasonal pattern identification
- β Business Intelligence: KPI design, metrics definition, dashboard strategy
- β Problem Solving: Identified real business issues and quantified opportunities
- β Communication: Translated technical analysis into executive-friendly insights
- β Strategic Thinking: Portfolio optimization, geographic expansion, customer segmentation
- β Project Execution: End-to-end delivery from raw data to actionable insights
- Problem Statement: "2,823 transactions from 2003-2005 in raw format lacked business structure"
- Analysis Approach: "Performed SQL data cleaning, RFM segmentation, profitability analysis"
- Key Insights: "Identified geographic risk (51% USA), product concentration (68% from 2 categories), seasonality (28% Q4 lift)"
- Deliverable: "Created interactive Tableau dashboard with 6 data sources and 8+ visualizations"
- Impact: "$200K-500K profit optimization opportunity and 40% faster reporting capability"
- Business Metrics: Explain CLV ($5,628), RFM framework, segment definitions
- Exploratory Analysis: Discuss how you discovered the 28% seasonal variance
- Visualization: Explain chart selection rationale and design principles
- Insights Communication: Demonstrate translation of technical findings to business recommendations
- Trade-offs: Discuss assumptions (70% cost model, 3-year CLV window)
Total SQL Queries: 15+ (cleaning, analysis, Tableau preparation)
Lines of SQL Code: 500+
Documentation Pages: 6 (README, Summary, Resume, Quick Start, Setup, Assets)
Visualizations Designed: 8+ chart types
Tableau Data Sources: 6 optimized queries
Database Tables/Views: 7 (original + derived analytical views)
Query Optimization: Yes (indexed, pre-aggregated for performance)
Data Quality Validation: 100% (0% null critical fields)
Business Opportunities ID: 5+ major optimization opportunities
- MySQL Date & Time Functions Documentation
- SQL Window Functions (NTILE, ROW_NUMBER, RANK)
- RFM Analysis Framework (Marketing Analytics)
- Customer Lifetime Value Calculation Methodology
- Tableau Best Practices for Dashboard Design
- Business Intelligence Concepts and KPI Design
| Metric | Value | Implication |
|---|---|---|
| Champions Value | $547K | Focus retention strategy |
| Geographic Concentration | 51.5% USA | Diversification needed |
| Top Product Profit | $886K (36.8%) | Expand Classic Cars |
| Seasonal Lift | 28% (Q4 vs avg) | Plan inventory for Q3 |
| Customer LTV | $5,628 | Justify acquisition spend |
- All queries indexed on DATE and PRODUCT_LINE
- Pre-aggregated views eliminate unnecessary calculations
- Parameterized queries for Tableau reduce refresh time
- Consider materialized views for frequently accessed metrics Markets Covered: 28 countries
https://public.tableau.com/app/profile/mansi.waghmare1807/viz/CustomerMarketAnalysis_17722429660290/CustomerMarketAnalysis https://public.tableau.com/app/profile/mansi.waghmare1807/viz/SalesPerformanceOverview_17722416499340/SalesPerformanceOverview