Back to the portfolio

BUSINESS INTELLIGENCE / WORKING APPLICATION

From numbers
to next steps.

A sales dashboard for exploring performance and asking better questions. Shared filters connect the charts, exports, and AI analysis, so every view starts with the same selected data.

PythonStreamlitSQLitePlotlyGemini

The public demo uses synthetic sales data. At review, analytics were available and the app reported “AI not connected.” AI features require a configured Gemini key.

Sample orders
3,629
Sample revenue
$2.29m
Sample profit
$762k
Workspace views
3

01 / THE PRODUCT

Explore the numbers.
Keep the context.

Business Insights brings revenue, profit, order count, and average order value into one workspace. Monthly trends, regional rankings, and product performance help users move from an overview to a specific question.

The included sample covers 1 January 2024 through 30 December 2025. The full dataset contains $2,291,665.87 in revenue and $762,071.09 in profit. These are demonstration figures, not client results or evidence of business impact.

01 / OVERVIEW

See the performance.

Filter by date and region. Explore monthly revenue and profit, compare products, then download the selected product table as CSV.

02 / ASK AI

Ask a focused question.

Use suggested questions or continue a conversation about the selected sales figures. Failed questions remain available for retry.

03 / INSIGHTS

Summarize the selection.

Generate an executive summary or recommended next steps, with prompts that request specific figures and distinguish suggestions from facts.

02 / THE ARCHITECTURE

One source for
charts and answers.

A Python pipeline generates synthetic orders, removes duplicate order IDs, fills missing regions with “Unknown,” and rejects nonpositive revenue or quantities. The cleaned data is loaded into SQLite.

The dashboard and AI helper use the same SQL aggregate functions. Date and region filters shape the KPI totals, monthly rows, product rankings, and regional figures before they are passed to either Plotly or Gemini.

The application does not execute SQL generated by a model. Gemini receives structured aggregates and chat context, with instructions to use those figures and avoid inventing causes, forecasts, or missing data. These instructions reduce ambiguity but do not guarantee factual answers.

Synthetic ordersCleaned dataFiltered SQL aggregatesCharts + Gemini

03 / DETAILS THAT MATTER

A filter changes
the whole story.

  1. Keep analysis in scope. Changing dates, regions, or the database clears previous AI results and chat. An old answer is not silently presented as analysis of a new selection.
  2. Respect the calendar. Partial boundary months are identified. Month comparisons use consecutive calendar months and flag gaps or zero baselines instead of substituting another period.
  3. Make empty states useful. No matching sales, incomplete dates, a missing database, and unavailable AI all have explicit states. The analytics remain usable without a Gemini key.
  4. Keep exports consistent. The CSV uses the same selected dates and regions as the dashboard, with amounts in USD.

04 / VALIDATION AND LIMITS

Check the figures.
Then trust the workflow.

The repository documents tests for totals, date boundaries, region filters, empty selections, calendar gaps, AI context consistency, navigation, and recovery states. AI calls in those tests are mocked; they do not establish the quality of live Gemini responses.

For this case study, I reviewed the implementation and the deployed overview. The live app displayed the expected sample totals and reported that AI was not connected. I did not run its test suite or generate a live AI response during this review.

Next steps could include a repeatable evaluation set for generated answers and a documented import workflow for new datasets. The current cleaner assumes one sales row per order, which would need revisiting for line-item transaction data.

Explore the other projects