**The brief.** The pivot in Lesson 1 looked like magic. It isn't — the entire table rests on ONE primitive: *the value at a coordinate is the sum of the facts sitting there.* Right now that primitive is stubbed to return `0`, so every check is red. **Write the one line, and the cells, row totals, column totals and grand total all light up green** — because they are all built on top of it.

You are re-implementing GroupRowsBy / GroupColumnsBy by hand. Once Cell is right, RowTotal, ColTotal and Grand — already written for you — need no further work. That is the whole claim of Lesson 1: one grouping rule generates every view.

The rules

If you are tempted to hard-code the totals, don't — that is exactly the double-entry the cube exists to abolish.

Your workbench

Notice what you did not have to write: no separate formula for row totals, column totals, or the grand total. One primitive, folded two ways, produced the entire table. That is the cube.


Stuck or done? Reveal the solution — the one line filled in, with every check green.

← Lesson 1 exercises · Lesson 1 — Why model as a cube

Reconnecting…
The connection to the server was interrupted. Trying to restore it…
Trying again…
The connection could not be restored. Reloading the page…
The server was updated. Reloading the page to pick up the latest version.