KOEN
All notes
DATA & AI

Two Octobers in the same three orders

Order dates give 160; settlement dates give 100. An executed example with three invented orders explores what defines a monthly total.

Three order cards with green and coral date tabs, two filter windows, a calendar and a calculator

Two numbers from a small table

I made a table of just three orders and added the October amounts. Selecting by order date gave 160. Selecting by settlement date gave 100. The table had not changed.

These are invented records, not company data. The units are arbitrary; the example is about dates and totals.

Order A has an amount of 100. It was ordered on October 31 and settled on November 2.

Order B is 60, ordered on October 30 and settled on October 31.

Order C is 40, ordered on September 30 and settled on October 2.

October order dates leave A and B: 100 plus 60 makes 160. October settlement dates leave B and C: 60 plus 40 makes 100.

No order was added twice, and a join did not multiply the rows. The date field used to decide what belongs in October changed.

Ask only “What was October revenue?” and even this tiny table needs someone to answer another question first: which definition belongs to that name?

I am not proposing either calculation as an accounting rule. The example deliberately has no such policy. Producing a total has not established which one the company should call revenue.

Without inventing the definition each time

I made the table while reading about sutura. The project describes a runtime for querying data through predefined metric definitions. I was interested in bringing the meaning of a number along with the convenience of asking for it.

For a small query tool over my example, I would start with separate names: order amounts by order date, and order amounts by settlement date. I would want the result to show which one was requested.

Letting an AI choose a plausible date column could initially feel helpful. If it chooses order date today and settlement date tomorrow, the person asking must explain changing numbers from unchanged records.

Reading the calculation code again might not settle that conversation. The code could have added exactly what it was told to add. The earlier choice of what to include still matters.

The official documentation describes loading definitions as a pinned catalog snapshot. That made me want a way to recover the definition used at the time alongside the numerical result.

Writing a definition into a file would not make it correct by itself. For my imagined tool, I would still ask whoever named the metric what work the total is meant to support.

If the definition changes later, I would want the earlier October result to retain its own reference. Someone who saw yesterday’s number should not quietly receive today’s definition in its place.

What I executed here was filtering dates and adding amounts in three invented rows. I did not connect sutura to company data. Even this small example left something to name before handing the question to a tool.

Which column held October?

I put 160 beside 100 again. The difference looks substantial on its own. Add the date-field names, and the two answers look less as though they are fighting over the same question.

Real material could bring cancellations, returns, timestamps and timezones to define as well. This table contains none of those conditions. Three rows still left a date choice to make.

Imagine taking one total into a meeting. Hearing that the number is wrong might make me reach for a calculator.

First, I would like to point to the table’s header and ask:

Did this October mean the day of the order, or the day of settlement?

Sources

All notes