All videos
Antvia Intelligence · Episode 6 of 8

Data models

Data models are the semantic layer in Antvia Intelligence: where a measure gets its definition and where two models are joined. This episode shows the three faults a semantic layer exists to prevent and usually does not: one measure defined three ways, a join that multiplies every number on one side, and a grain that hedges. It reads the model register and a model's detail, opens the model editor to see the joins drawn on a board and the conflict check that runs as you type, and fixes a hedging grain live.

7:268 chapters887 wordsSilent, with captions

Also on YouTube, with the rest of the Antvia Intelligence series. The whole episode is written out below, with the timing, if you would rather read it.

Chapters

What happens, in order.

0:00
Introduction
Title card.
0:07
Where a number gets its meaning
The model register: certified models, the measure defined three ways, the two joins that multiply measures, the hedging grain, and drafts that dashboards depend on.
1:18
Reading a model
The register columns, and the Sales performance model opened: its warnings, grain, measures and relationships.
3:20
The joins, drawn
The model editor for Sales performance: the board of tables, the safe many-to-one joins, the red many-to-many join, a filter on a table, and selecting a table to see what it can produce.
4:34
Checked as you type
The net_revenue measure marked as clashing, the other definitions shown, and editing an expression with the check re-running on every keystroke.
5:32
Pin down the grain
Opening the Marketing spend model in the editor, the hedging grain warning, and rewriting the grain so the warning clears.
6:21
Where the models are used
How the semantic layer reaches Lens, Echo and Arc: the metric registry that Arc checks proposals against, and the home page items for model faults.
7:03
Close
Closing card.
Transcript

The whole episode, in words.

The videos are silent, with the captions burned in. This is the same text, with the timing, so you can find the part you need without scrubbing for it.

Introduction

0:00
Antvia Intelligence. Data models. One definition per measure, joins that cannot quietly inflate a total, and a grain that says what one row is.

Where a number gets its meaning

0:07
Where a number gets its meaning. The model register and its three warnings.
0:12
Data modelsData models is the semantic layer at Acme Home Appliances, a demo company: what each measure means, and at what grain. Dashboards, Echo and the decision register all read it.
0:26
Eight modelsEight models, five of them certified.
0:31
One word, three sumsnet_revenue is defined three different ways. Sales performance counts billing after discounts; the marketplace model nets off returns and fees; service counts parts and labour.
0:41
Both rightEach definition is reasonable. Two people asking one question get two answers, both correct, in the same meeting.
0:51
Fan-outTwo joins will silently multiply a measure. A many-to-many join counts each left row once per match, so the total always comes out high.
1:01
Why it survivesHigh numbers do not get questioned. Nobody queries a total that came in above target.
1:09
GrainOne model does not say what one row is, and three draft models are already depended on.

Reading a model

1:18
Reading a model. Sales performance, the one leadership reads.
1:22
GrainEvery model states its grain: one row per what. The register puts it second, after the name.
1:30
Clashes per modelClashing measures and joins are counted per model, so the risky ones stand out.
1:38
Sales performanceSales performance is one row per distributor, model and month, rebuilt incrementally every morning. Nine dashboards and answers depend on it.
1:47
Its joinsThe panel leads with the fan-out: joining it to marketplace order lines on category multiplies every measure on this side.
1:56
Its clashAnd the clash: net_revenue is also defined elsewhere, differently.
2:03
A measure that reads a filePercent to plan reads the uploaded targets file, which nobody has replaced since May. The description says so, where an analyst will see it.
2:14
As of todayRegion is as of today, not as of the period. A distributor that moved region takes its history with it, and the field says so before anybody compares years.
2:29
A hedging grainMarketing spend says it is one row per campaign, sometimes per campaign per day. That is two grains, and a join cannot tell them apart.
2:43
Closed, not visitedService operations counts SLA met as tickets closed inside the promised window. Closed and visited differ by about nine percent, and the description says which one this is.
2:57
Not certifiedChannel inventory is one row per model per distributor per day, and it is not certified. Four dashboards and answers depend on it anyway.
3:08
Refreshed, not freshIt refreshes every morning at six. The channel stock tables underneath have not moved since 30 July, so each refresh rebuilds the same old stock.

The joins, drawn

3:20
The joins, drawn. The model editor puts the fan-out where you can point at it.
3:30
The boardThe editor draws the physical tables behind the model and the joins between them, field to field.
3:39
Many to oneInvoice lines join the distributor master many to one. That is the safe shape.
3:46
Many to manyInvoice lines to marketplace order lines, on category alone, is many to many. It is drawn in red, and every measure on invoice lines comes out high.
3:58
A filter on the cardInvoice lines carries a filter: cancelled invoices are excluded, because they keep their lines. A filter here changes every measure, so it sits on the card.
4:11
Start from a tableSelect a table and everything it does not touch dims, and the panels on the right narrow to what it can count and slice by.
4:25
Measures and group byOn the right, measures and group-by fields, as tabs. The measures tab carries a warning dot while anything clashes.

Checked as you type

4:34
Checked as you type. A clash that nobody can miss.
4:39
Clashesnet_revenue is marked as clashing. Every one of the three definitions was written by somebody sensible, in an editor that told them nothing.
4:51
The othersThis editor tells them: the other two definitions are listed at the top, word for word.
5:02
Still clashingChange the expression and the check runs again on every keystroke. It still disagrees with the other two, and the banner stays.
5:11
Not a blockIt does not stop the save. Sometimes a team genuinely means something different. It makes the disagreement impossible not to have noticed.
5:26
UnsavedThe editor tracks the draft. Cancel leaves the model as it was.

Pin down the grain

5:32
Pin down the grain. Fix the hedging grain, live.
5:38
Two grainsMarketing spend in the editor. Its grain hedges, and the editor says why: "sometimes per campaign per day" is two grains.
5:47
Why it mattersThis model joins marketplace orders on campaign, and neither side has a unique key. Until the grain is one row per one thing, that join can duplicate rows.
6:03
Pinned downOne row per campaign per day. The warning clears as soon as the grain stops hedging.
6:10
Then the dataThe next step is making the data match the sentence: one row per campaign per day, which the marketing team can now build to.

Where the models are used

6:21
Where the models are used. Dashboards, answers and decisions all read them.
6:28
The registryThe decision register reads the same layer. Thirty-one measures form the metric registry, and a proposal is only admitted if it names one of them.
6:39
One meaningSo net revenue in a decision is the same net revenue on a dashboard, or the clash is on screen for everyone to see.
6:53
On the home pageAnd the model faults rank first on the Intelligence home page, above the firing alerts, each linking back to Data models.

Close

7:03
One meaning for every number. Measures defined more than once, found before the meeting. Joins that would inflate a total, drawn in red. A grain that says what one row is, or a warning. The same registry behind dashboards, answers and decisions.
Next step

See it on your own data.

Thirty minutes on the half you came for. Bring the report that breaks every month, or the decision you never settled.