CASE STUDY 03 / Personal project · Data & analytics

Customer Analytics Dashboard.

From retail transactions to customer behavior.

A retail analysis pipeline that connects revenue trends, purchasing behavior, and customer segmentation.

  • Python
  • SQL
  • SQLite
  • pandas
  • Streamlit
  • scikit-learn
MY ROLE

Data preparation, SQL analysis, clustering & dashboard development

CONTEXT

Independent portfolio project · Public retail dataset

STATUS

Source and chart outputs available

Actual monthly revenue chart from the retail analysis, showing revenue increasing in late 2011 before a partial final monthCustomer analytics monthly revenueView full size
Actual chart from the retail analysis. The aggregate values describe the public dataset, not a client’s business or personal results.

THE CONTEXT

The problem

Transaction rows do not immediately explain which customers contribute the most, how revenue changes over time, or whether purchasing patterns form meaningful groups. This project makes those questions easier to investigate.

MY CONTRIBUTION

What I built

  • Cleaned retail transaction data with pandas, removing missing customer IDs and rows with non-positive quantities or prices.
  • Created revenue features and used SQL/SQLite to analyze monthly revenue and customer spending.
  • Standardized customer-level features and applied K-Means to form three spending-based segments.
  • Built a Streamlit dashboard with revenue, customer, transaction, and segmentation views.

HOW IT CONNECTS

From input to useful output

  1. 01

    Prepare

    Retail spreadsheet → validated purchase rows → cleaned CSV.

  2. 02

    Analyze

    SQL summaries and standardized spending, order, and item features → K-Means.

  3. 03

    Explain

    Aggregate charts and a Streamlit dashboard → patterns a business can investigate.

THE REASONING

Decisions & tradeoffs

Make the cleaning rule explicit

Excluding returns and non-positive rows creates a purchase-focused view. That makes the dashboard easier to interpret, but its revenue measure should not be mistaken for net revenue after refunds.

Keep segments interpretable

StandardScaler prevents large-value features from dominating K-Means. Clusters are labeled by average spending; those labels are descriptive, not proven marketing recommendations.

CHECKING THE WORK

Testing & validation

The cleaning script filters invalid purchase rows, and the analysis exposes customer and monthly aggregates for inspection. The current segmentation code measures spending and frequency-related behavior; it does not calculate recency or implement full RFM analysis.

WHERE IT STANDS

Outcome & limitations

A reproducible path from a retail dataset to a working dashboard and saved visualizations. It demonstrates both the implementation and the business questions behind an analysis.

Three clusters are a modeling choice, not an independently validated optimum. Recency, cluster stability checks, and a clearer order-level average would be useful next steps: the current average feature is calculated at transaction-line level. Only aggregate visuals are reproduced here.