A visual explainer

What is a
Semantic Layer?

Think of it as a menu for your data. Instead of cooking raw SQL from scratch every time, you pick what you want and the kitchen handles the rest.

Scroll
01 — The Problem

Hidden rules
everywhere.

Want to know last quarter's revenue? Here's the SQL. Looks simple, but there are 5 hidden rules you have to get right — or your numbers are silently wrong.

SELECT apollo_customer_type, SUM(sku_level_attributed_revenue_usd) AS revenue
FROM dbt2_semantic.shopify_ledger_prod
WHERE
  transaction_date >= '2025-10-01' AND transaction_date < '2026-01-01'Must use < not <= or you miss same-day data   AND order_source = 'Store'Without this, dealer/B2B sales inflate revenue 23%   AND is_revenue_generating = trueOmit this and non-revenue records pollute results   AND sku_level_attributed_revenue_usd != 0Zero-revenue rows add noise to aggregations   AND NOT (entitlement_type = 'Subscription' AND sku_level_attributed_revenue_usd > 0 AND sku_level_attributed_revenue_usd < 2)Must exclude micro-charges but keep negative refunds GROUP BY 1
5 hidden rules — get any one wrong and your numbers are silently incorrect
02 — The Idea

A menu,
not a kitchen.

A semantic layer is like ordering from a restaurant menu instead of cooking in the kitchen yourself.

🔥
Without — Raw SQL
You're in the kitchen
  • You write every query from scratch
  • You memorize which filters to include
  • You know which field means what
  • Different people get different numbers
  • One wrong filter = silently wrong results
📋
With — Semantic Layer
You order from a menu
  • Pick what you want to measure (revenue, customers)
  • Pick how to slice it (by product, by quarter)
  • All the rules are baked in automatically
  • Everyone gets the same numbers
  • Impossible to use the wrong formula
03 — How It Works

Four steps.
Zero SQL.

You ask a question in plain English. The semantic layer translates it into perfect SQL every time.

01
💬
Ask
"How much revenue did
Apollo customers make
last quarter?"
02
📋
Pick from Menu
Measures: revenue
Slice by: customer type
Time: Q4 2025
03
⚙️
Auto-Generate
Semantic layer writes
the correct SQL with
all 5 hidden rules
04
Answer
Guaranteed correct
numbers, every time,
for everyone
04 — Before & After

Same question.
Different experience.

Three real questions, shown both ways. Hover the red-highlighted lines in Section 1 to see the traps hiding in raw SQL.

Question
Without — Raw SQL
With — Semantic Layer
Top 10 plugins
by revenue
SELECT sku, SUM(...)
FROM shopify_ledger_prod
WHERE order_source = 'Store'
  AND is_revenue_generating
  AND revenue != 0
  AND NOT (micro-charges)
GROUP BY 1
ORDER BY 2 DESC
LIMIT 10
measures: revenue
slice by: product
sort:     revenue desc
limit:    10

✓ All filters applied
  automatically
New vs existing
customer split
SELECT new_existing_purchaser,
  COUNT(DISTINCT purchaser_id),
  SUM(sku_level_attributed_
    revenue_usd)
FROM shopify_ledger_prod
WHERE (5 filter rules...)
GROUP BY 1
measures: customers, revenue
slice by: new vs existing

✓ Knows to count by
  purchaser_id, not
  customer_id
Monthly revenue
trend for Q4
SELECT DATE_TRUNC('month',
  transaction_date),
  SUM(...)
FROM shopify_ledger_prod
WHERE transaction_date
  >= '2025-10-01'
  AND < '2026-01-01'
  (+ 4 more rules...)
GROUP BY 1 ORDER BY 1
measures:   revenue
time:      Q4 2025
grain:     monthly

✓ Date boundaries
  handled correctly
05 — Why It Matters

The payoff.

🎯
One source of truth
Revenue is defined once. Everyone — analysts, AI, dashboards — uses the same formula. No more conflicting numbers.
Before: 3+ different revenue numbers floating around
🛡️
No silent mistakes
Forget a filter in raw SQL and nobody notices — the query still runs, just with wrong numbers. A semantic layer makes that impossible.
Example: missing order_source inflates revenue 23%
🤖
AI can't hallucinate
When AI writes SQL, it can invent filters or use wrong fields. A semantic layer gives AI a fixed menu — it picks from validated options only.
Reduces AI query errors from ~20% to ~0%
A semantic layer turns "write the correct SQL" into "pick what you want from a menu" — and the menu guarantees correct answers every time.