ENES

Semantic layer

One place that defines a company's metrics, so every tool computes them the same way.

Raw warehouse tables at the bottom, a middle band defining revenue and active customer once, and three consumers on top, a dashboard, a spreadsheet and an AI assistant, all reading the same definitions

A semantic layer sits between the raw tables of a data warehouse and the tools people use to ask questions. In it, the data team defines business concepts once, in code: what "revenue" means (net of refunds? with tax?), what an "active customer" is, how tables join, which time zone a "day" uses. Dashboards, spreadsheets and other tools then ask for revenue by month and the layer writes the correct SQL for them.

The problem it solves is painfully common: marketing's dashboard says 12,400 active customers, finance's spreadsheet says 11,900, and both are "right" because each one encoded its own definition in its own tool. When the logic lives in one layer instead of being copied into every report, a definition changes in one place and every consumer gets the new version. It is the same idea as a function in programming: write the rule once, call it everywhere.

Examples include the dbt Semantic Layer, Cube, LookML in Looker and AtScale. It has become more important with AI: when a language model answers "how did revenue do last quarter?", pointing it at well-defined metrics is far more reliable than letting it guess joins and filters from hundreds of raw tables. A semantic layer is often paired with data governance, since it is where the official meaning of each number is written down.

Keep in mind

Go deeper

Related terms

More in Data