CH 59 / 86Chapter 8: In Practice: At Work

Data Analysis and Reports

On this page10 items

In 10 seconds

Claude can aggregate data and make charts, but don’t let it count by eye.
The right approach is to have code do the calculating and have Claude think about “what to calculate.”

Don’t let it count by eye#

This is the most important principle.

As covered in No.17 in Chapter 2, Claude is not good at exact counting. The official documentation says so explicitly. Hand it a CSV and ask “What’s the total?” and you’ll get a plausible-looking number. Sometimes it’s right, sometimes it isn’t.

The right approach is to have it write and run code.

text7 lines
For the attached CSV, please calculate the following.

- Do not eyeball it; always write and run code
- Show me the code you used for the calculation
- Also report the number of rows and any columns with missing values

What to calculate: (write it here)

Include the line “use code, not eyeballing” every time. If the code runs, the result is a calculator’s answer. The code might be wrong, but code can be read.

Discuss what to calculate#

Where Claude really shines is not calculation but design.

text7 lines
Look at the columns in the attached CSV and tell me:

- 5 questions this data can answer
- 3 questions that look answerable but actually aren't
- Places where the data quality may be a problem

Don't aggregate anything yet.

The second item is the one that pays off. Ruling out “questions it can’t answer” up front saves you from pointless aggregation later.

Charts#

It can make them. But if you don’t specify, you’ll get hard-to-read ones.

text6 lines
Make a line chart from this data.

- Always include axis labels and units
- Don't connect the line across missing periods; break it
- State whether the axis starts at 0 or partway up, and explain why
- No more than 3 colors

The third item quietly makes a big difference. Starting the axis partway up makes changes look bigger. If it’s not intentional, it’s an accident.

With Artifacts from No.15 in Chapter 2, you can tweak it on the spot.

Turn it into a report#

Turning aggregated results into prose is something it does well.

text6 lines
From the aggregated results, create a one-page summary for the executive meeting.

- Put the conclusion in the first 3 lines
- Use only numbers that are in the results. For anything missing, write "not yet aggregated"
- When describing trends, distinguish causation from correlation
- As the final item, include what these numbers cannot tell us

Always include that final item. A report that states “what it can’t say” earns trust.

Make it recurring#

If you run the same aggregation every week, this spans several chapters.

  • Local files → Cowork in Chapter 4, or Claude Code in Chapter 5
  • Cloud documents → Scheduled runs in Chapter 4 (No.31)
  • Built into your own system → The API in Chapter 7

The golden rule for making it recurring is the same as in Chapter 4, No.31: always have it report the difference from last time. When a weekly aggregation quietly breaks, you won’t notice without a diff.

Before you hand it over#

Think before handing over data that can’t leave your company. Sometimes preprocessing is needed, such as dropping columns that identify individuals or rounding amounts (No.78).

Try it: Have it calculate with code (5 min)

Prepare a CSV you have on hand. If you don’t have one, any spreadsheet file will do.

Prompt
“`
For the attached file, please tell me the following.

  • Number of rows and column names
  • Number of missing values in each column
  • If there are numeric columns, their sum and mean

Do not eyeball it; always write and run code.
Show me the code you used.
“`

Expected result: You get code and its output. The row count matches the file.

If it doesn’t work: If you get only numbers with no code, that’s an answer counted by eye. Tell it again: “Write and run code.”

Common pitfalls#

Trusting eyeballed totals. This is the most common accident. Always use code.

Not checking the row count. Sometimes the file has only been read partway. Check that the row count matches first.

Using a chart with an arbitrarily truncated axis. Changes look bigger. Unless it’s intentional, start from 0.

Mixing causation and correlation. This is what reports get called out on most.

Related pages#

Summary#

  • Don’t let it count by eye. Always calculate with code
  • Its strength is not calculation but designing what to calculate
  • For charts, specify axes, units, and how to handle missing data
  • Always include what these numbers can’t tell us in reports

Read next#

Websites and running a blog