← All posts

Guides · Oct 5, 2026

Data analysis and dashboards with Claude Code

Turn the Excel sheet you update every month into an interactive HTML dashboard you can use in meetings and adapt for different audiences. Claude Code builds it, and Python checks every number.

Built by Simon + Claude

dashboard.html
InvestmentNet present value

NOK 532k

Payback in 3.2 years

NOK m

NOK 600k
CheckChecks passed

4 of 4

Total matches, checked 28 Sep 2026

  • Rows read4 of 4OK
  • Duplicate rowsNoneOK
  • Total against the source reportNOK 42,900 = NOK 42,900OK
  • Dates readable4 of 4OK
SensitivityNPV range

NOK 1.01m

Saving in year 1 moves it most

± 20%
KPIRevenue, 12 months

NOK 62.9m

West −35% in August, flagged by the check

NOK m a month

Four small dashboards in one browser window, with example data for Company A. Investment, a net present value of NOK 532k and payback in 3.2 years, with the saving in year 1 as a slider. Check, 4 of 4 checks passed on the data before it reaches the page, rows read, no duplicate rows, the total of NOK 42,900 matches the source report and the dates are readable, checked 28 Sep 2026. Sensitivity, the saving in year 1 moves the net present value most, with the swing as a slider. KPI, revenue over 12 months per region, where West drops 35 per cent in August 2026 and the check flags it. Every number is calculated in the page.

Investment, sensitivity, a KPI view and the data check in one HTML file.

TL;DR

  • An HTML dashboard lets you move the assumptions and watch the numbers follow. Sliders, filters and charts update together, in one file that opens in any browser.
  • Python works out the numbers for the page to draw. Every number comes from code that ran on your data, never from a sentence the model wrote.
  • Take one spreadsheet you update every month and ask Claude Code to turn it into an interactive HTML page.

Most analysis still ends as a table in a spreadsheet or a chart pasted into a slide, as a static snapshot. The first question in the meeting is often what happens if the saving is lower, and someone has to go back to the spreadsheet to answer it. A page with the assumptions as sliders answers it in the meeting.

In Deterministic and non-deterministic AI we wrote that an AI agent should work out the numbers in Python. In The magic powers of HTML we wrote that a page can do things a document cannot. This guide puts the two together, for the numbers you look at every week.

We build these with Claude Code. You can do the same in Claude Cowork, ChatGPT Work and Codex, since all of them can run Python and write an HTML file.

What an HTML dashboard can do

An HTML page is the same kind of file as every web page, and a dashboard is a page that holds numbers.

RevenueTarget NOK 1.2m
NOK 1.08m
NOK 450 × 2,400 units
Recalculate

Drag a slider and every number follows.

NOK m
−0.8
0.5
2.2
WorstExpectedBest
Compare

Three scenarios side by side.

Last 12 monthsNOK 19.2m
Filter

Click a region and see only its numbers.

Explain

Point at a bar and see the number behind it.

Tell

Lead the reader step by step as they scroll.

Share

One file, any browser, nothing to install.

Six small working examples of what an HTML dashboard can do. Recalculate, a price slider drives the revenue and a bar against a target. Compare, three scenarios side by side or this year on last year. Filter, chips that show one region at a time. Explain, a bar chart where each bar shows its value and the assumption behind it. Tell, a chart that highlights one step of the story at a time. Share, a single dashboard.html file that opens in a browser window.

Six things you can ask a dashboard page to do.

Python checks and calculates the data, and the page draws it and lets you play with it. The formula behind a slider is also code in the page, so the same slider position always gives the same number.

Every number is saved inside the file, so only send the page to people who are allowed to see all of them.

A pipeline that checks the data first

A dashboard draws whatever is in the export, errors included. Exports often hold duplicate rows, mixed date formats and amounts stored as text. A chart drawn on them looks just as convincing as one drawn on clean data.

A pipeline is a few Python scripts that the AI agent writes once and runs in the same order every month.

SourcesCRM exportExcel fileCSVPythonCheckCleanTransformdata.jsonHTMLdashboard.htmlStop andreportIf a check failsSourcesPythonHTMLCRM exportExcel fileCSVCheckCleanTransformdata.jsondashboard.htmlIf a check failsStop and report

CheckPython compares the export with the source before anything moves on.

  • Rows read4 of 4OK
  • Duplicate rowsNoneOK
  • Total against the source reportNOK 42,900 = NOK 42,900OK
  • Dates readable4 of 4OK

Every check passes, so the data moves on.

A pipeline in example data. Three sources, a CRM export, an Excel file and a CSV, flow into Check, then Clean, then Transform, which Python runs, then into one clean data file, data.json, and on to an HTML dashboard. Under Check a dashed branch goes to Stop and report, taken if a check fails. With the clean export every check passes and the data reaches the dashboard. With the export with errors one row appears twice, the total no longer matches the source report, and the pipeline stops at Check and reports instead.

Python checks, cleans and transforms the exports, and HTML draws the result. Switch to the export with errors to see the Check step stop the run.

The AI agent can help decide what counts as the same customer, and the script applies the decision to every row.

The check runs before the page is built, so a page with wrong totals never gets made. Claude Code keeps the scripts in the project folder, and a line in its instruction file, CLAUDE.md, says to always build the dashboard through them.

You

Make a Python pipeline for this export. First check it for rows, duplicates, empty cells and whether the totals match the source, and stop and tell me if anything does not match. Then clean it, sum it per month and region, and write the result into the dashboard. Keep the original file untouched and save each step as a script in the scripts folder. The check runs first every time, and the page is only built when it passes.

Investment analysis with sliders

I spent years presenting financials in Excel and PowerPoint. Every new question meant going back to the spreadsheet and coming back with a new slide. With the assumptions on one page, we can test them together in the meeting, and the same page works for the board, the bank or a partner.

An investment case rests on a few assumptions about cost, savings and time. In a spreadsheet the assumptions sit in cells, and changing one means opening the file and finding the right cell. On a page each assumption is a slider, and the net present value, the payback time and the cash flow follow as you drag.

Assumptions
InvestmentNOK 2.0m
Saving in year 1NOK 600k
Growth in saving3%
Discount rate8%
Lifetime5 years
Net present valueNOK 532k
Payback3.2 years
IRR17.4%
−2−1012NOK mPaybackYear012345−2−1012NOK mPaybackYear012345

NPV = the saving for each of the 5 years, growing 3% a year and discounted at 8% a year, minus the investment. Payback = when the running total passes zero.

Investment case for Company A, example data. NOK 2.0m invested, NOK 600k saved in year 1, growing 3% a year, discounted at 8%, over 5 years. Net present value NOK 532k. Payback 3.2 years. IRR 17.4%.

An investment case for Company A, with the formula written under the result.
You

Build an investment calculator as one HTML page. Company A invests NOK 2 million to automate a process that saves NOK 600,000 in the first year. Make sliders for the investment, the yearly saving, growth in the saving, the discount rate and the lifetime. Show the net present value, the payback time and a chart of the yearly cash flow. Write the formula under the result in plain words, and put everything the page needs inside the one file.

With the formula written out in plain words, anyone in the meeting can check how the number was made, and so can you beforehand.

Sensitivity and scenarios

One set of assumptions gives one number, and it does not tell you how much that number can move. A sensitivity chart moves one assumption at a time up and down, keeps the others still, and draws how far the result moves.

Swing±20%
−0.50.00.51.01.52.0NOK mBase 0.53Investment0.13 → 0.93Saving in year 10.03 → 1.04Growth in saving0.50 → 0.56Discount rate0.43 → 0.65Lifetime0.07 → 0.97−0.50.00.51.01.52.0NPV, NOK mBase 0.53Investment0.130.93Saving in year 10.031.04Growth in saving0.500.56Discount rate0.430.65Lifetime0.070.97

Saving in year 1 at NOK 480k gives an NPV of NOK 26k, at NOK 720k it gives NOK 1.04m.

Worst−NOK 813kAll five moved 20% the wrong way
ExpectedNOK 532kThe assumptions as they are
BestNOK 2.2mAll five moved 20% the right way

Base case NOK 2.0m invested, NOK 600k saved in year 1, growing 3% a year, discounted at 8%, over 5 years. NPV NOK 532k.

Sensitivity of the investment case for Company A, example data. Each assumption moves 20% down and up while the others stay put. Widest first. Saving in year 1 from NOK 26k to NOK 1.04m. Lifetime from NOK 73k to NOK 971k. Investment from NOK 132k to NOK 932k. Discount rate from NOK 427k to NOK 645k. Growth in saving from NOK 504k to NOK 560k. The assumption that moves the result most is saving in year 1. Worst case −NOK 813k, expected NOK 532k, best case NOK 2.2m.

Which assumption moves the result most. Each bar moves one assumption up and down by the same share.

The widest bar is the assumption to check before anything else. Scenarios move every assumption at once, to a worst, an expected and a best case. That gives you three numbers for a board paper.

You

Add a sensitivity chart to the investment calculator. Move each assumption down and up by 20 per cent while the others stay put, and sort the bars by how much the net present value changes. Add a slider for the 20 per cent. Under it, show a worst, expected and best case.

A KPI dashboard from an export

Most teams already have the data, as a monthly export from the CRM, the accounting system or a shared spreadsheet. A dashboard built on the export shows the same few numbers every month, lets you filter by region and marks what changed.

Company A, example data, Oct 2025 to Sep 2026
Revenue, 12 months
NOK 62.9m
+5.1% on the year before
Orders
4,212
+3.4% on the year before
Average order value
NOK 14,931
+1.6% on the year before
NOK m a month

Sep 2026 · All regions NOK 5.75m

Source sales_export.csv · 4,212 rows · checked 28 Sep 2026 · 3 rows flagged

KPI dashboard for Company A, example data from October 2025 to September 2026, showing all four regions. Revenue over 12 months is NOK 62.9m, +5.1% on the year before. 4,212 orders, +3.4%. Average order value NOK 14,931, +1.6%. A line chart shows monthly revenue for North, West, East and South. West drops 35% from July to August 2026, and that point is flagged by the check. Source sales_export.csv, 4,212 rows, checked 28 September 2026, 3 rows flagged.

A sales dashboard built from one export. The check flagged West in August, and the page shows it.
You

Build a sales dashboard as one HTML page from sales_export.csv. Three tiles at the top with revenue, orders and average order value for the last twelve months, and the change on the year before. A monthly chart under them, and a filter for region. Mark any month where a region drops more than 20 per cent. Put the source file, the number of rows and the date the data was checked in a line at the bottom.

Telling a story with the numbers

Here are the same sales numbers told as a story. Scroll, and the chart changes with each step.

What the data does not show

The data shows when and where the drop happened. It does not show why. Before anyone guesses, ask the West team what happened in August.

The question for the meetingWhat happened in West?NOK 0.94m in August, NOK 1.65m in September
NOK m · axis starts at 50

Source sales_export.csv · 4,212 rows · checked 28 Sep 2026 · 3 rows flagged

01

Last year, NOK 59.86m

Company A's revenue from October 2024 to September 2025. The bridge goes from here to this year, one region at a time.

02

East, South and North added NOK 2.78m

East grew the most, NOK 1.68m. South added NOK 0.57m and North NOK 0.52m.

03

West added only NOK 0.26m

West is the second largest region, and it grew 1.5%. The other three grew between 4 and 8 per cent.

04

This year, NOK 62.89m

October 2025 to September 2026, 5.1% more than the year before. In total, the year looks steady.

05

West fell 35 per cent in August

From NOK 1.45m in July to NOK 0.94m in August, then back to NOK 1.65m in September. The check on the export flagged August before the meeting.

06

What the data does not show

The data shows when and where the drop happened. It does not show why. Before anyone guesses, ask the West team what happened in August.

Bridge chart of revenue for Company A, example data, in NOK million, with the axis starting at 50. Last year, October 2024 to September 2025, NOK 59.86m. East adds NOK 1.68m, South NOK 0.57m, North NOK 0.52m and West NOK 0.26m, to NOK 62.89m this year, October 2025 to September 2026, +5.1%. West by month falls 35% from NOK 1.45m in July to NOK 0.94m in August, a month flagged by the check. Source sales_export.csv, 4,212 rows, checked 28 September 2026, 3 rows flagged.

Company A's sales as a bridge from last year to this year, then West month by month.
You

Turn the sales dashboard into a story for Monday's meeting. Build a bridge from last year's revenue to this year's, one region at a time, then show the region that grew least, month by month. Each step makes one point and highlights one thing in the chart. End with what the data does not tell us.

Python for heavier analysis

Sliders and filters work when you know which assumption to move. Some questions need more mathematics than a formula on a page. Python has ready-made tools for most of them, and you do not need to know their names. Describe what you want to know.

  • Correlation shows which numbers move together and how strongly, such as delivery time and customer satisfaction, or price and repeat purchases.
  • Regression shows how much one number changes when another moves, with the others held still, such as how many points satisfaction falls for each extra day of delivery.
  • Monte Carlo simulation gives each assumption a range instead of one value, runs the investment case thousands of times, and shows how often the net present value ends below zero.
  • Forecasts and outliers show where a trend is heading if nothing changes, and which customers or months behave differently from the rest.
Correlation, 2,400 orders
−0.380.54−0.620.310.050.22−0.270.18−0.210.41Repeat purchaseDelivery daysSatisfactionDiscountPrice−0.380.54−0.620.310.050.22−0.270.18−0.210.41Repeat purchaseDelivery daysSatisfactionDiscountPrice
−0.62Delivery days · Satisfaction
Longer delivery, lower satisfaction
Strong, negative

A pattern, not proof of a cause

A correlation matrix for 2,400 orders in example data, with five variables, repeat purchase, delivery days, satisfaction, discount and price. The strongest pair is delivery days and satisfaction at minus 0.62, longer delivery goes with lower satisfaction. Satisfaction and repeat purchase follow at 0.54, then price and discount at 0.41. Pick a cell to see the dots for that pair.

Five columns from 2,400 example orders. Pick a cell to see the orders behind the number.

Python can draw charts too, but they come out as pictures or separate pages with their own look. I ask for the results as a data file and let the page draw them, so every chart shares one design.

Correlation and regression show that numbers move together. They do not say which one moves the other, or whether a third one moves both. Ask the AI agent to say what it calculated, what might explain it, and what the data cannot tell you.

You

Use Python to find which of these columns move together with customer satisfaction, and how strongly. Tell me how sure you are and what the data cannot tell me. Do not draw the charts in Python. Write the results to a data file, and put the numbers and the charts into the dashboard page itself.

Monte Carlo, NPV of 10,000 runs
22%chance the NPV ends below zero
Mean NOK 548k
NOK 0

Mean NOK 548k · median NOK 495k

Saving in year 1 NOK 600,000 ± NOK 120,000, investment NOK 2,000,000 ± NOK 200,000, growth in saving −2 to 8%, discount rate 6 to 10%, lifetime 4 to 6 years

A histogram of the net present value from 10,000 runs of the investment case for Company A, example data. In each run the saving, investment, growth, discount rate and lifetime are drawn at random within their ranges. The mean is NOK 548,000 and the median NOK 495,000, and 22 per cent of the runs end below zero. A slider moves the threshold, and the share of runs below it updates.

The investment case run 10,000 times in Python. Move the threshold to see the chance of ending below it.
You

Give each assumption in the investment calculator a low, a likely and a high value. Run the model 10,000 times in Python and add a chart of the results to the page, with the share of runs where the net present value is below zero.

The system pays off over time

The first dashboard costs the most. You and the AI agent work out the method, write the scripts and check the numbers, and that takes both time and tokens.

When the AI agent reads the export itself, it reads every row, and next month costs as many tokens again. With scripts in the folder, the scripts read the rows and the AI agent sees only the few lines they return.

136912The AI agent readsthe export every timeScripts in the folderSavedPays off from run 3Run
Effort over time. The shape shows the pattern and is not a measurement.

Once the scripts exist, the tokens go to what needs judgement, such as why West looks different in August.

Try it on a spreadsheet you know

Pick one spreadsheet you update every month, where you already know one number, such as last month's total or the number of customers. Use only data you are allowed to share with the tool. Put it in a folder, open the folder in Claude Code and ask your question.

Check the size of the Excel file first. If you can, export the sheet you need as a CSV file, which is much easier, cheaper and faster for AI to work with. If the workbook has many tabs, images or other things that are not relevant, remove them before you start.

You

This is a spreadsheet I update every month. Start by telling me what one row represents, and whether anything is missing or duplicated. My question is [write it here]. Build one HTML page that answers it, with the assumptions as sliders and the source in a line at the bottom. Use Python for every number.

Check the number you already knew. If it matches, ask Claude Code to save the scripts in the folder.

An agent in a folder shows how the folder with the scripts, the data and the instructions becomes an agent you can use again every month.