One question, four answers
A small shop: 13 orders over three months, three products. Each row of the table has the order date, the delivery date, the store, the product, the price, the quantity and how many units came back. Management asks what management always asks: how much did we sell in October?
There are four ways to answer, all defensible:
- gross sales, by order date: €4,200;
- gross sales, by delivery date: €3,600;
- sales net of returns, by order date: €2,800;
- sales net of returns, by delivery date: €2,900.
Between the largest and the smallest there is €1,400. And the next question makes it worse: was October better than September? By gross sales on the delivery date, it went up 71.43%. By net sales on the order date, it went down 3.45%. The same table and the same month give a rise of more than seventy percent or a fall.
None of these sums is wrong. Two orders show where the difference comes from. One was placed on 29 September and delivered on 2 October: €900 that belong to September under one definition and to October under the other. The other, placed on 30 October, only arrived on 3 November, and half of it came back: eight blenders sold, four returned.
Now replace management with an AI. You hand over the whole table and type "how much did we sell in October?". It will give you a number, in a well-built sentence. Which of the four?
Where this came from
The request comes up often in AI projects, almost in the same words: process the whole table and generate the analysis. The home version is dropping the CSV into the chat and asking for "insights". The answer comes back fast, confident and well written. The number in it has no origin, and the metric has no definition.
This entry is the question that request leaves behind: what changes when the AI receives the quantities already computed, with a definition and a period, instead of the raw rows?
In Entry 02 the sum was about when to let the AI answer on its own. This one is a step earlier: what to put in front of it.
Calculating is one thing, interpreting is another
Answering "how much did we sell in October?" takes two decisions and one sum. The decisions: what counts as a sale (what went out, or what went out and didn't come back) and on which date the sale counts (when the customer ordered, or when they received it). The sum comes afterwards, and it's the easy part:
where p is the price, q the quantity and d the quantity returned, adding up only the rows whose chosen date falls in the month.
The calculation is deterministic. Written in SQL or in pandas, it gives the same result every time, and it can be tested with a small table whose answer is known. Interpretation is a different activity: looking at −3.45% next to +40.00% and asking what happened to the returns.
When the raw table goes to the AI with a request for analysis, the two activities get mixed, and three things happen silently:
- It picks the definition for you. To return a number it has to decide between gross and net, between order and delivery. It may even choose well. You don't find out which one it chose unless you ask, and on the next question it may choose another.
- The table becomes a long text. To a language model, 13 rows are a paragraph; a real table is thousands of rows in the middle of the context. Liu and colleagues measured what happens to information in that position: performance is highest when the relevant passage is at the beginning or the end of the context, and degrades significantly when it is in the middle. The study uses questions over documents and key-value retrieval, not sales tables; what matters here is the mechanism.
- There is no way to redo it. A SQL query is stored, with a date and an author. A chat answer depends on the model, the version and how the question was worded that day.
Quantity is a physics word
Nobody hands a physicist the list of a car's positions and asks for the average velocity without saying between which instants and in which unit. And even then a choice remains. A car drives to the next town and comes back. If the quantity is displacement divided by time, the average velocity of the trip is zero. If it is distance travelled divided by time, it isn't. Both sums are right; they measure different things. Gross sales are the distance travelled. Net sales are the displacement: what went and came back doesn't count. First you define the quantity, then you calculate, and only then do you interpret. Dimensional analysis is the habit of not skipping that order.
A sales table doesn't hold "October's sales". It holds several, and someone has to choose which one before asking.
Do the sum yourself
The bench below shows the raw table, with the 13 orders, and asks the opening question: how much did we sell in October? Answer before reading on. A calculator is fine, a spreadsheet is fine, adding in your head is fine.
Bench · Do the sum yourself
13 made-up orders · September to November 2026How much did we sell in October? Do the sum with the table below before opening the answers. Values are in euros.
| order | order date | delivery date | store | product | price | quantity | returned |
|---|---|---|---|---|---|---|---|
| P01 | 2026-09-03 | 2026-09-05 | Central | coffee maker | 200 | 2 | 0 |
| P02 | 2026-09-10 | 2026-09-12 | North | blender | 150 | 4 | 0 |
| P03 | 2026-09-18 | 2026-09-21 | Central | toaster | 100 | 5 | 1 |
| P04 | 2026-09-24 | 2026-09-26 | North | coffee maker | 200 | 3 | 0 |
| P05 | 2026-09-29 | 2026-10-02 | Central | blender | 150 | 6 | 0 |
| P06 | 2026-10-02 | 2026-10-05 | North | toaster | 100 | 4 | 0 |
| P07 | 2026-10-08 | 2026-10-10 | Central | coffee maker | 200 | 5 | 2 |
| P08 | 2026-10-14 | 2026-10-16 | North | blender | 150 | 2 | 0 |
| P09 | 2026-10-20 | 2026-10-23 | Central | toaster | 100 | 6 | 3 |
| P10 | 2026-10-27 | 2026-10-29 | North | coffee maker | 200 | 2 | 0 |
| P11 | 2026-10-30 | 2026-11-03 | Central | blender | 150 | 8 | 4 |
| P12 | 2026-10-31 | 2026-11-02 | North | toaster | 100 | 3 | 1 |
| P13 | 2026-11-04 | 2026-11-06 | Central | coffee maker | 200 | 1 | 0 |
Check: the four answers
| definition | October |
|---|---|
| Gross sales, by order date | €4,200 |
| Gross sales, by delivery date | €3,600 |
| Sales net of returns, by order date | €2,800 |
| Sales net of returns, by delivery date | €2,900 |
Look for your answer in the list. If it is there, that is the definition you used without anyone asking. If it isn't, go back over the sum: two definitions probably got mixed. Between the largest and the smallest answer there is €1,400.
The second part: the table of quantities
| quantity | October | September | change |
|---|---|---|---|
| Gross sales, by order date | €4,200 | €3,000 | +40.00% |
| Gross sales, by delivery date | €3,600 | €2,100 | +71.43% |
| Sales net of returns, by order date | €2,800 | €2,900 | −3.45% |
| Sales net of returns, by delivery date | €2,900 | €2,000 | +45.00% |
Gross sales: price × quantity. Net sales: price × (quantity − returned). By order date: it counts in the month the order was placed. By delivery date: it counts in the month it arrived. The return is deducted in the month of the sale itself.
After you check, the bench shows the four definitions and tells you which one your answer matches. If it matched one, notice that you picked a definition without anyone asking, probably the one you use at work. If it matched none, you probably mixed two: counted one order by delivery date and another by order date, or deducted one return and forgot another. It is the mistake the raw table invites, whoever receives it.
The second part of the bench swaps the raw table for the table of quantities:
- gross sales, by order date: €4,200 in October, €3,000 in September, +40.00%;
- gross sales, by delivery date: €3,600 in October, €2,100 in September, +71.43%;
- net sales, by order date: €2,800 in October, €2,900 in September, −3.45%;
- net sales, by delivery date: €2,900 in October, €2,000 in September, +45.00%.
That is four rows instead of thirteen, and every number has a name. With this table in front of you, "how much did we sell in October?" stops being a question with a hidden answer: it depends on which row you want, and each row says what it is. And the question worth asking an AI, or an analyst, appears: why did gross sales rise 40.00% and net sales fall 3.45% in the same month? The answer is in the returns. October's orders had €1,400 returned, against €100 for September's.
The table the AI should receive
The table of quantities is not just the table summarised. It is a summary with three things written next to each number:
- the definition: what goes in, what stays out and on which date it counts. For example: "net sales are price times quantity, minus what was returned; the return is deducted in the month of the sale itself";
- the period and the comparison: October 2026 against September 2026, and not against October of the previous year;
- the origin: which query produced the number, who checked it and when.
With that, the request to the AI changes in nature. Instead of "analyse this table", it becomes "here are the four measures of October sales, with the definition of each and the comparison with September; explain the difference between them and say what deserves attention". The arithmetic arrives done and checked. What is left for the AI is to compare, explain and write.
There is one more practical advantage: you can check the answer without a magnifying glass. Every number that appears in the AI's text has to be one of the numbers in the table of quantities, or a simple operation between two of them. A number that isn't there was made up, and a short program finds it.
Where the money is
- In the number that goes up to management. "October grew 40%" and "October fell 3.45%" lead to opposite decisions on stock, targets and campaigns. A wrong number in a report for management can cost more than the entire AI project. And here both numbers are right: the mistake is not saying which is which.
- In the rework. A quantity computed in code runs the same way next month. An analysis requested from the chat over the raw table has to be redone, and checked, every time.
- In the size of what the AI reads. When used from a program, language models are billed by the volume of text going in and out. A real raw table has thousands of rows; the table of quantities has the rows the decision needs. This text did not measure that difference in money.
How to use this in practice
1. Write the definition before the query
For each metric the AI will use: what goes in, what stays out, on which date it counts and which period it is compared with. One sentence per metric is enough. If two departments use different definitions, both go in, each under its own name.
2. Calculate in code you can test
SQL, pandas, whatever the team already uses. And a test with a small table whose answer is known, like the one in this entry: 13 rows, four answers, all checked by hand. When someone touches the definition, the test tells you.
3. Hand over the table of quantities, with the glossary
The AI receives the computed measures, the definition of each one and the period. The raw rows stay in the database.
4. Ask for interpretation, not arithmetic
"Explain the difference", "what deserves attention", "write the summary for management". If the analysis calls for a new cut, by store or by product, the cut goes back to step 2: it becomes a new quantity, computed in code.
5. Check the numbers in the answer
Every number in the final text has to exist in the table of quantities. That check is automatic and cheap. After it, someone with a name signs the report before it goes up.
Where this breaks
- "The AI runs code, so the problem is gone." Part of it, yes. There is a line of work in which the model writes the program and an executor does the sum: Cheng and colleagues bind the model to a language such as SQL, and Wang and colleagues make the reasoning go through intermediate tables, one operation at a time. The sum comes out right. But the sum of what? The code the AI writes needs a definition of a sale. If nobody wrote one, it carries a guess, now looking like an exact number. This text did not test any model; the argument is about definition, not performance.
- The "right" definition is more than one. Different departments use different definitions, with good reason. The way out is not to choose one and erase the others. It is to name each one and never show a number without its name.
- The table of quantities hides the detail. Whoever sees only the four rows doesn't see the order of eight blenders with four returns. If the cause is in one row, the AI has no way of finding it in a summary. That is why step 4 sends the new cut back to the code, and not to the raw table.
- Returns don't respect the month. Here the return is deducted in the month of the sale itself. In real life it arrives weeks later, and "which month to deduct it from" is a third choice, with more right answers.
- Definitions age. The exchange policy changes, what counts as a delivery changes. A glossary with no owner and no date becomes the same raw table, only smaller.
To reproduce
The core of the sum fits in a few lines, with nothing but Python's standard library:
def vendas(linhas, mes, valor, data):
"""Month total under the chosen definition.
valor: "bruto" (gross) or "liquido" (net); data: "pedido" (order) or "entrega" (delivery)."""
total = 0
for linha in linhas:
if linha["data_" + data][:7] != mes:
continue
quantidade = linha["quantidade"]
if valor == "liquido":
quantidade -= linha["devolvida"]
total += linha["preco"] * quantidade
return total
vendas(linhas, "2026-10", "bruto", "pedido") # 4200
vendas(linhas, "2026-10", "bruto", "entrega") # 3600
vendas(linhas, "2026-10", "liquido", "pedido") # 2800
vendas(linhas, "2026-10", "liquido", "entrega") # 2900References
Long contexts
- Liu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F. & Liang, P. (2023). Lost in the Middle: How Language Models Use Long Contexts. arXiv:2307.03172, accepted at Transactions of the Association for Computational Linguistics.performance drops when the relevant information sits in the middle of a long context
The model writes, the program calculates
- Cheng, Z., Xie, T., Shi, P. et al. (2022). Binding Language Models in Symbolic Languages. arXiv:2210.02875.the model turns the question into a program; an executor does the sum
- Wang, Z., Zhang, H., Li, C.-L. et al. (2024). Chain-of-Table: Evolving Tables in the Reasoning Chain for Table Understanding. arXiv:2401.04398.the reasoning goes through intermediate tables, one operation at a time
Want to know whether your tables are ready for AI?
Vettore Data runs the diagnostic: it lists the metrics the AI will use, writes down the definition of each one with the people who know the business, and says what to calculate first. The executive version of this entry, with a three-question test, is there.
See the diagnostic at Vettoreor get in touch