How anand-analytics/customer-behaviour-dashboard works
Purpose and Entry Points
This is a retail customer-behaviour analytics project: it transforms raw shopping records into cleaned analytical data, answers business questions in SQL, and presents KPIs in a Power BI dashboard. Primary artifacts are the source dataset at Data/customer_shopping_behavior.csv, the cleaning notebook at Python/Python Data Cleaning.ipynb, SQL analysis at SQL/SQL_Queries.sql, and the dashboard at Power BI/Customer_Behaviour_Analysis_Dashboard.pbix.
1. Raw Customer Shopping Data
Data/customer_shopping_behavior.csv is the system-of-record input. It contains customer demographics, purchases, product/category information, reviews, discount/promotion behaviour, shipping, subscriptions, and purchase frequency. Its schema is the contract consumed by the Python cleaning stage.
2. Python Cleaning and Feature Engineering
Python/Python Data Cleaning.ipynb is the primary transformation entry point. It prepares the CSV for database and reporting use by:
• imputing missing review ratings using the category median;
• converting column names to snake_case;
• removing the redundant promo_code_used field;
• deriving age_group and numeric purchase_frequency_days.
This notebook forms the boundary between source-format data and an analysis-ready relational/reporting dataset.
3. MySQL Analytical Layer
SQL/SQL_Queries.sql contains the business-analysis query layer intended to run after cleaned data is loaded into MySQL. Queries aggregate and segment customers, products, revenue, discounts, and ratings. Material analytical techniques include CTEs, CASE-based lifecycle segments, ranking, and ROW_NUMBER() window functions for top products per category.
The notebook-to-MySQL load step is implied by the workflow but is not represented as a standalone ingestion script in the repository.
4. Customer and Revenue Segmentation
The SQL layer produces decision-oriented segments: revenue by gender and age group, high-spend discount users, discount-dependent products, product rating rankings, and New/Returning/Loyal customer groups based on purchase frequency. These outputs support marketing, engagement, product, and subscription decisions rather than operational transaction processing.
5. Power BI Semantic and Presentation Layer
Power BI/Customer_Behaviour_Analysis_Dashboard.pbix is the management-facing consumption endpoint. It imports or connects to the prepared dataset and defines dashboard measures for customer count, average purchase amount, and average review rating. Its visuals cover revenue/category, sales/age group, and subscription status; slicers expose gender, subscription, category, and shipping-type filters.
6. End-to-End Control Flow
The intended flow is:
1. Read Data/customer_shopping_behavior.csv.
2. Clean and enrich it in Python/Python Data Cleaning.ipynb.
3. Load the cleaned records into a MySQL table.
4. Execute SQL/SQL_Queries.sql for advanced analysis and validation.
5. Refresh Power BI/Customer_Behaviour_Analysis_Dashboard.pbix to provide interactive KPI exploration.
There is no application server, API, scheduler, or automated orchestration represented in the file tree; execution is analyst-driven through Jupyter, MySQL, and Power BI.
7. Runtime and Infrastructure Boundaries
Material runtimes are Python/Jupyter for transformation and EDA, MySQL for relational querying, and Power BI Desktop/Service-compatible .pbix reporting. The repository stores the raw CSV and report artifact, but does not include MySQL schema definitions, database connection settings, packaged Python dependencies, or a persisted cleaned-data export. These are operational integration points for anyone reproducing or automating the workflow.
Main entry points: SQL_Queries.sql Business analysis queries · Customer_Behaviour_Analysis_Dashboard.pbix Customer behaviour dashboard · Python Data Cleaning.ipynb Cleaning & feature engineering · customer_shopping_behavior.csv Customer shopping records
Components 11
Source Data
- Customer shopping records · System-of-record customer and purchase data.
Data/customer_shopping_behavior.csv
Preparation
- Cleaning & feature engineering · Imputes ratings, normalizes fields, and derives analysis features.
Python/Python Data Cleaning.ipynb - Analysis-ready records · Cleaned records with age group and purchase-frequency days.
MySQL Analytics
- Customer analytics table · Implied analyst-loaded relational dataset.
- Business analysis queries · Aggregates, segments, ranks, and validates customer behaviour.
SQL/SQL_Queries.sql - Revenue & demographic segments · Revenue by gender and age group plus high-spend discount users.
- Product & rating insights · Discount-dependent products and top-rated products per category.
- Customer lifecycle segments · New, Returning, and Loyal groups based on purchase frequency.
BI Reporting
- Customer behaviour dashboard · Management-facing interactive KPI and segmentation reporting.
Power BI/Customer_Behaviour_Analysis_Dashboard.pbix - KPI measures · Customer count, average purchase amount, and average review rating.
- Interactive visuals & slicers · Revenue, category, age, subscription, gender, and shipping exploration.
Connections 14
- Customer shopping records → Cleaning & feature engineering: read source schema
- Cleaning & feature engineering → Analysis-ready records: clean and enrich
- Analysis-ready records → Customer analytics table: analyst loads · No ingestion script is stored in the repository.
- Customer analytics table → Business analysis queries: query
- Business analysis queries → Revenue & demographic segments: aggregate and segment
- Business analysis queries → Product & rating insights: rank and analyze
- Business analysis queries → Customer lifecycle segments: classify lifecycle
- Customer analytics table → Customer behaviour dashboard: connect or import
- Analysis-ready records → Customer behaviour dashboard: alternative import
- Customer behaviour dashboard → KPI measures: defines
- KPI measures → Interactive visuals & slicers: powers
- Revenue & demographic segments → Interactive visuals & slicers: informs decisions
- Product & rating insights → Interactive visuals & slicers: informs decisions
- Customer lifecycle segments → Interactive visuals & slicers: informs decisions