offdataai
← All courses
offdataai Learn · Intermediate

Build a semantic layer

Turn a star schema into governed metrics that every dashboard and AI agent computes the same way.

Start learning for $1/month

5 lessons · about 60 minutes · included in Explorer

Intermediate5 lessons · about 60 minutes

Build a semantic layer

Turn a star schema into governed metrics that every dashboard and AI agent computes the same way.

Outcome: You can define simple, ratio and filtered metrics that stay correct at every level of aggregation.

  1. 1

    Define your first governed metrics

    Write revenue and order count once, so every dashboard and AI agent computes them the same way.

    Define governed metrics · 12 min · instant checks

  2. 2

    Ratio metrics and filters

    Average order value is revenue ÷ orders, not the average of a column. And cancelled orders don't count.

    Define governed metrics · 12 min · instant checks

  3. 3

    Semi-additive and non-additive measures

    Stock on hand adds up across warehouses but not across days. Tell the semantic layer which dimension it must never sum over.

    Define governed metrics · 12 min · instant checks

  4. 4

    Dimensions, hierarchies and time grains

    A metric can only be sliced by dimensions its fact table actually joins to. Declaring them is what stops a wrong answer before it is drawn.

    Define governed metrics · 12 min · instant checks

  5. 5

    Metric governance: one name, one meaning

    Trust comes from one definition per name, descriptions that say what is in and out, and a named owner who settles disputes.

    Define governed metrics · 10 min · instant checks

What you will be able to do

  • ✓Define a metric as an aggregation over a column
  • ✓Pick the right aggregation for an order-line grain
  • ✓Give every metric a description people can trust
  • ✓Build a ratio metric from two existing metrics
  • ✓Explain why averaging a column gives the wrong answer
  • ✓Put business rules in a metric's filter
  • ✓Tell additive, semi-additive and non-additive measures apart
  • ✓Mark a balance measure as non-additive across dates
  • ✓Build a ratio instead of summing a stored percentage
  • ✓Restrict a metric to the dimensions its fact joins to
  • ✓Explain how hierarchies and time grains roll a metric up
  • ✓Work out which dimensions a ratio of two facts can use
  • ✓Keep one definition per metric name and give other meanings their own name
  • ✓Write descriptions that state inclusions, exclusions and an owner
  • ✓Recognise the naming habits that make metrics hard to trust
Included in Explorer

Every course and every exercise for $1 a month.

Explorer also includes the Model Builder, all 174 templates and SQL for every warehouse. Cancel anytime.