Data analysis with AI

Sign in to save progress
0:00
0:00

On this lesson: Turning a business question into a prompt

The discussion is for premium members.Go premium
  • Be the first to say something about this lesson.

Prefer reading? Every lesson in this course as text

Read this lesson as text: Turning a business question into a prompt

Turning a business question into a prompt

What exactly is an analysis prompt? Let's try to understand. In a simple way. Your boss asks, why did sales drop last quarter.

That is a business question. Nothing in it is something a machine can compute. A colleague would fill those blanks from memory. Which table, which column, what you meant by sales.

The model has none of that. The prompt is all it sees. And a vague prompt never fails. The model picks the most likely reading and answers that one.

A confident answer to a question you did not ask. So the job is to say out loud what the question hides. Almost always three things. The measure, the slice, and the comparison.

The measure. Sales is not a number yet. It needs a column and one operation. Sum of order value, or count of orders.

Not the same answer. The slice. Which rows count. Recently is not a filter.

April to June, India, cancelled orders removed. The comparison. A drop only exists against a baseline. Down from last quarter, or down from the same quarter a year ago.

Different stories. Put the three back in and the wish becomes an instruction. Sum order value by month, April to June, India, against last year. Here is the test.

If two analysts read your prompt and land on the same number, it is a prompt. If not, it is still a wish. A business question says what you care about. A prompt says what to compute.

That is the whole translation. Quick check now. One question is coming up. Let's see if it clicked.

Read this lesson as text: How an AI reads your spreadsheet file

How an AI reads your spreadsheet file

How does an AI read your spreadsheet file? Let's try to understand. In a simple way. First, the model never opens your file.

It cannot. All it ever receives is text in a prompt. The tool around it does the opening. And under that pretty grid, your file is mostly text.

In a CSV, a comma sits between cells, and a line break ends each row. The reader turns your sheet back into lines. The top line becomes your column names, and it guesses a type for each one. Number, date, or text.

Now the problem. Fifty thousand rows would be millions of tokens. Your whole sheet will not fit in the prompt. So the tool sends a slice.

The column names, the guessed types, the row count, and maybe the first five rows. So the model is reading the shape of your data, not every value in it. A sample, and a label for each column. Which is why, for a real total, it writes a few lines of code, and your tool runs that code over the full file.

One catch with Excel. A cell keeps both the formula and the last value it saved. The reader takes that saved value, so a stale sheet stays stale. Some things never arrive.

Color is not data. Merged headings come through as blanks, and a title above your header shifts everything by one. So, the tool reads the file, and the model reads a preview. Give it clean column names, and it starts from the right picture.

Quick check now. One question is coming up. Let's see if it clicked.

Read this lesson as text: What AI does with messy, missing data

What AI does with messy, missing data

How does AI handle messy, missing data? Let's try to understand. In a simple way. Start with the blank cell.

To your tool, a blank is not a zero. It is a marker that says, no value here. And blanks wear many faces. An empty cell, a dash, the letters N A, the word null.

Only the ones you name count as missing. Here is the sneaky one. One text value inside a number column, and the whole column is read as text. Your sum refuses to run.

So what does the AI actually do? For a missing value it has only two moves. Drop the row, or fill it in. Dropping is honest, but it shrinks the data.

Ten thousand rows become nine thousand, and your average now describes only the survivors. Filling invents a number. Usually the column's average, or its middle value. The row stays, but every gap gets pulled toward the middle.

Messy also means labels. North, capital North, and north with a trailing space are three different groups. Grouping compares text exactly. Here is the real risk.

The model saw only a preview, so it picks a default quietly, and the finished chart never mentions it. So ask for the rule. How many rows were dropped, what filled the blanks, which labels were merged. Counts, before the chart.

So, missing data forces a choice. Drop or fill. Name your missing markers, and make the AI report what it did. Quick check now.

One question is coming up. Let's see if it clicked.

Read this lesson as text: Telling AI what kind of chart to make

Telling AI what kind of chart to make

What exactly is a chart request? Let's try to understand. In a simple way. When you ask for a chart, you are not asking for a picture.

You are filling in a small form. Every blank you leave, the model fills for you. That form has four blanks. The chart type.

What runs along the bottom. What runs up the side. And what splits into colors. Show me sales by region fills none of them.

Say it plainly. A bar chart, one bar per region. And these blanks take column names, exactly as your header spells them. Order value is a column.

Revenue is a word you made up. The side blank is never just a column. It is a column and an operation. Sum of order value, or average order value.

Two different charts. Now the order. Bars come out in sheet order unless you ask. Say sorted highest to lowest.

And cap it. Top ten, the rest as other. A third column becomes color. Two products inside each region.

Say grouped side by side, or stacked into one bar. Those look nothing alike. Under it all, the chart tool has one slot per channel. Your sentence is poured into those slots.

What you skipped gets a default, quietly. So say the whole thing in one line. A bar chart of total order value by region, top ten, highest first. So, a chart request is type, bottom, side, and split.

Name all four, and the picture in your head is the picture you get. Quick check now. One question is coming up. Let's see if it clicked.

Read this lesson as text: How to iterate on your analysis prompt

How to iterate on your analysis prompt

What exactly is a follow-up prompt? Let's try to understand. In a simple way. Start with why a follow-up works at all.

The model keeps nothing between turns. Your chat tool re-sends the entire conversation every time you hit send. And it does not edit the chart you already have. Each turn writes the analysis again from the top.

A tiny fix is really a full rewrite. So change one thing per turn. Ask for three at once, watch it get worse, and you cannot tell which of the three broke it. Saying that is wrong tells it nothing.

It cannot see your screen. Say what you expected and what you got. I asked for monthly, these bars are weekly. Also say what to keep.

A rewrite has no reason to preserve anything you did not mention. Keep the sort and the date range, change only the colors. And it never pushes back. Ask for a change that makes no sense, and you still get a new chart, with exactly the same confidence.

Ten turns in, your spec is scattered across ten messages. Turn two said sorted by size. Turn six said top five. Both are still in the prompt, and it picks one.

So when it drifts, stop patching. Go back to the version you liked, fold your changes into one fresh prompt, and start a clean thread. So, every follow-up is a fresh run over the whole conversation. One change, name the gap, and rewrite the prompt when it drifts.

Quick check now. One question is coming up. Let's see if it clicked.

Read this lesson as text: How AI writes code to create your chart

How AI writes code to create your chart

What exactly is chart code? Let's try to understand. In a simple way. You ask for a bar chart.

But the model cannot paint pixels. It has exactly one output, and that output is text. So it writes a small program instead. About ten lines.

Load the file, group the numbers, draw the bars, save the image. The model does not run that program. Your tool does. There is a real Python session sitting behind the chat window.

The picture you see comes out of that run, not out of the model. Your chart is a file that a program wrote. And the code holds none of your data. It points at column names.

Revenue, region, date. The values stay in the file until the program opens it. So a single wrong name breaks everything. The run fails with an error, the tool hands that error back, and the model rewrites its own code.

But code that runs is not code that is right. Group the wrong column, filter the wrong year, and it still draws a clean, confident chart. Which is the quiet gift here. Open the code.

It is short. Check the column it grouped, and check the filter line. And a program can be run again. Same code, same file, same chart.

Next month you swap in the new file and rerun it. So, the model writes code, your tool runs the code, and the run makes the picture. Read the code, because a chart that renders can still be wrong. Quick check now.

One question is coming up. Let's see if it clicked.

Read this lesson as text: Why AI chose a bar chart, not pie

Why AI chose a bar chart, not pie

How does the chart choice work? Let's try to understand. In a simple way. You asked for sales by region, and got bars.

Nobody chose bars. You left the chart type blank, so the model filled it from the shape of your columns. Shape means one text column with a few repeated labels, and one number column beside it. That pairing has a standard answer.

And the answer is copied, not reasoned. It has read millions of charting scripts. Category plus number, bars. Numbers over dates, a line.

Two numbers, a scatter. Bars win the comparing job for a real reason. Every bar starts on the same baseline, so you compare lengths, and eyes rank lengths instantly. A pie asks for something harder.

Compare angles and wedge areas, with no shared starting line. Past four slices, two close wedges look identical. So pie keeps one narrow job. Parts of one whole, a handful of them, adding to a hundred percent.

If a row can be counted twice, that whole does not exist. Here is the catch. Shape is not meaning. Twelve months stored as text look like twelve categories, so you get bars in alphabetical order when you wanted a line.

Because your goal is nowhere in the file. Comparing, or showing a share of one total. Same two columns, different chart. Say which one, and the guessing stops.

So, the type came from your column shapes, matched to the most common pairing. Bars to compare, pie only for parts of one whole. Quick check now. One question is coming up.

Let's see if it clicked.

Read this lesson as text: How AI spots the outlier in your data

How AI spots the outlier in your data

How does AI spot the outlier in your data? Let's try to understand. In a simple way. The model does not scan your numbers and notice something odd.

It never sees the whole column. It writes a rule, and that rule runs over every row. Every outlier rule has the same three parts. A middle, a spread, and a cutoff distance.

Anything past the cutoff gets flagged. Two common recipes. The mean with the standard deviation. Or the median with the gap between the quarter marks.

Same data, two different lists. And three standard deviations is a convention, not a law. Move it down to two, and your list gets longer. That cutoff was picked for you, quietly.

Here is the trap. In the mean recipe, the extreme value helps compute the very spread it is judged against. One huge number stretches the spread, and hides itself. The rule also reads one column alone.

A number can be ordinary for one store and extreme across all of them. So ask it to flag inside each group. Flagged means unusual. It does not mean wrong.

A typing error and your best month ever look the same to the rule. Only you can tell them apart. And do not let it delete those rows. A dropped row moves every average after it.

Ask to see them listed, with the reason for each. So, spotting an outlier is a cutoff rule running over your rows. Ask which recipe, ask which cutoff, and look before anything is removed. Quick check now.

One question is coming up. Let's see if it clicked.

Read this lesson as text: Asking AI to compare two data columns

Asking AI to compare two data columns

How does comparing two columns work? Let's try to understand. In a simple way. You say, compare revenue and returns.

But there is no compare function. Your tool has to pick one concrete move, and it picks quietly. Whatever it picks, the pairing comes from rows. Row seven's revenue sits with row seven's returns.

Position by position, never by meaning. And the kind of columns decides the move. Two numbers, it subtracts, or plots the pairs. A label and a number, it splits rows into groups.

Ask how they relate, and you often get correlation. One number, from minus one to one, squeezing every pair down to how tightly they rise together. That number only sees a straight line. A clean U shape scores near zero.

And two columns can climb together because a third one drives both. A pair also needs both cells filled. Every row missing either value drops out of the comparison. So ten thousand rows get compared as eight thousand.

And subtraction never checks units. Dollars minus units sold runs fine and means nothing. A difference reads only when both columns share one unit. Careful with raw totals.

One region shows more complaints, and also ten times the customers. Comparing counts needs a shared base. Ask for the rate. So make the move explicit.

Say per row difference, or group averages, or correlation. Compare is your word, not an instruction. So, comparing two columns is one operation, chosen for you, running down the pairs that survived. Name the operation.

Check the base. Quick check now. One question is coming up. Let's see if it clicked.

Read this lesson as text: How to generate a full data dashboard

How to generate a full data dashboard

How does a data dashboard work? Let's try to understand. In a simple way. A dashboard is not one big chart.

It is six small ones, pinned onto a single screen. So the word dashboard tells the model almost nothing. Because somebody has to decide which six. Ask for a dashboard and the model invents the list.

Name the questions yourself. One tile, one question. Underneath, each tile is its own little program and its own run. Six tiles means six loads, six groupings, six separate pictures.

And they all open the same file. But the filter gets written again inside every tile. Nothing checks that the six copies match. So two tiles can disagree.

One drops cancelled orders, the next one forgets. Both numbers are computed correctly, and they sit side by side. The fix is boring and it works. Slice once, at the top.

Then say every tile starts from that one filtered table. Layout is a blank you fill too. Eyes land top left. Put the headline number there, the trend under it, the details below.

And label every tile on its own. Title, units, and the date range. Tiles get screenshotted alone, with no dashboard around them. One more thing.

A tile that breaks fails alone. The other five render fine, so a missing panel looks like a design choice, not an error. So, a dashboard is a list of questions, one run each, sharing one slice. Write the list, filter once, and label every tile.

Quick check now. One question is coming up. Let's see if it clicked.

Read this lesson as text: How to double check the AI's calculations

How to double check the AI's calculations

How does checking the AI's calculations work? Let's try to understand. In a simple way. Start where the risk actually is.

The adding up is done by code, and code adds correctly. What goes wrong is which rows it added. So your first check is a count. Ask it to print how many rows it began with, and how many survived every filter.

Because a filter can quietly drop rows. Blank dates. Names that did not match. The average coming back is exact, and it is the average of what was left.

Second check. The pieces should rebuild the whole. Four region totals must sum to the grand total. If they do not, something was dropped or counted twice.

Third check. Pick a single row and work it out by hand. One row tells you whether the formula means what you think it means. Then ask for the code, not another explanation.

It shows the filter, the exact columns, and what each percentage is divided by. That is where the definition lives. And never settle for asking, are you sure. That is a fresh guess, not an audit.

It will agree, or flip to a new number, sounding just as confident. A real second opinion takes a different route. Total the twelve months, then total the raw orders. The same figure by two paths is evidence.

Asking twice is not. So, check the definition, not the addition. Count the rows, make the parts rebuild the whole, do one by hand, and derive it a second way. Quick check now.

One question is coming up. Let's see if it clicked.

Read this lesson as text: When your AI's chart tells a false story

When your AI's chart tells a false story

What exactly is a misleading chart? Let's try to understand. In a simple way. Your numbers can be completely right, and the picture still wrong.

Drawing is a second step. The chart makes choices the numbers never made. A bar chart makes one claim. Compare these lengths.

But a length only means a value when its scale starts at zero. And the default is not zero. The library zooms in to fit your data. Start the axis at ninety eight, and a tiny gap looks like a cliff.

The chart also draws only the rows it was handed. Hand it the last three months of a five year decline, and the line climbs. One bar is often a collapse. A thousand rows squeezed into one average.

The spread that made the number interesting is simply not drawn. A line joining two dots asserts everything between them. You measured January and June. That smooth slope through the middle was drawn, not measured.

Two lines on two different axes. Then the point where they cross was set by the scaling, not by the data. Rescale, and the crossing moves. And the title?

That is text, written from your prompt. The model captions the story it expected. Nothing compares that sentence to the picture. So say it in the prompt.

Start the axis at zero. Use the full date range. Show the spread, not just the average. So a false story comes from drawing choices, not from bad arithmetic.

The numbers passed. Ask what the picture is quietly assuming. Quick check now. One question is coming up.

Let's see if it clicked.

Read this lesson as text: How AI summarizes a chart in one sentence

How AI summarizes a chart in one sentence

How does a one sentence chart summary work? Let's try to understand. In a simple way. Ask for a summary and the model never looks at your picture.

The tool hands it the numbers behind the chart, labels and values. So the sentence is written from that table. And one sentence is only a length. Nothing in the word summarize says which fact matters.

So it reaches for the loudest thing in the numbers. The tallest bar. The steepest jump. Loudest is not the same as important.

The other common answer is your chart title, read back. This chart shows revenue by region. True, and it carries no finding. One sentence also holds about one comparison.

The rest of the chart is dropped, quietly, and it never says what it left out. Now watch for the word because. Your table holds labels and values. There is no cause column.

So a reason in that sentence came from language, not your data. So name the headline yourself. The biggest change since last quarter. Or the largest share.

Now the pick is a rule, and the rule is yours. Then make it quote the numbers it used. Both values, and the gap. Up eleven percent can be checked against the table.

Strong growth cannot. Run it twice on the same chart and two different sentences come back. Both true. So the summary is a pick, not a fact.

So, the sentence comes from the table, not the picture. Name the headline, ask for the numbers, question every because. Quick check now. One question is coming up.

Let's see if it clicked.

Read this lesson as text: From chart insight to a suggested action

From chart insight to a suggested action

What exactly is a suggested action? Let's try to understand. In a simple way. A chart answers what happened.

An action answers what to do next. Only the first one lives in your file. Because your table is labels and values. There is no column for why it moved, and no column for what you can change.

So where does the advice come from? The model has read a mountain of business writing. It returns a likely sentence with your label dropped in. Here is the test.

Rename your regions to product names and run it again. If the same advice comes back, it was fitted to the shape. The suggestion also arrives with no constraints. Your budget, your headcount, the thing you already tried last year.

None of that is in the file. So paste it in. Say we can change price, ad spend, or staffing. Now it picks from your list instead of inventing one.

Watch for a hidden cause. Sales fell when price rose, so drop the price. The chart showed two lines moving together. Never which moved the other.

Then ask for a testable shape. Who does what, by when, and which number should move. Boost engagement is a mood, not a step. Ask for three options, and what each one assumes.

Then run the cheapest first. Ranking them needs your costs, and those are not in the file. So, the file says what happened. You bring the levers and the limits.

Every suggestion is a hypothesis you still have to test. Quick check now. One question is coming up. Let's see if it clicked.

Read this lesson as text: How to save and reuse your analysis chain

How to save and reuse your analysis chain

What exactly is an analysis chain? Let's try to understand. In a simple way. It is the ordered set of steps that took you from a raw file to one chart.

Load, clean, filter, group, plot. Your chat scroll looks like it saved them. It did not. A scroll is a transcript, with your wrong turns still in it, and nothing in it runs.

Type the same prompt next month and the code can come back different, because every word is a weighted draw. So save the code it wrote, not the words you typed. A reusable chain is frozen text with named holes. The file name, the date range.

Change the holes, never the steps. Save your decisions too. What counted as active. Why you dropped those rows.

Code shows what happened, never why you chose it. Next month's file is the real risk. One renamed column and step three quietly breaks. So step zero checks the names and the row count.

Reuse means replay. Run the saved code first, and call the model only for what is genuinely new. Same numbers, in seconds. Edit one step and the numbers move.

So keep a dated copy, and stamp each chart with the version that made it. A colleague can rerun your work with three things. The file, the steps, and your definitions. A screenshot is none of them.

So, a chain is your steps saved as something that runs. Freeze the order, name the holes, check the columns. Quick check now. One question is coming up.

Let's see if it clicked.