Loading...
Loading...
Define datasets, dimensions, measures, joins, and SQL previews before turning analytics requirements into production semantic-layer code.
warehouse.fact_orders
These are the building blocks of the semantic model.
A source table or logical table at a defined grain.
Orders: one row per order, keyed by order_id.
An aggregated business metric users ask for in reports.
Revenue = SUM(gross_amount - discount_amount).
A descriptive field used to group, filter, or slice measures.
Order Date, Customer Segment, Product Category.
A relationship that lets fields from two datasets be used together.
Orders many-to-one Customers on customer_id.
SELECT DATE(orders.created_at) AS order_date, SUM(orders.gross_amount - orders.discount_amount) AS revenue FROM warehouse.fact_orders AS orders LEFT JOIN warehouse.dim_customers AS customers ON orders.customer_id = customers.customer_id GROUP BY 1
A semantic layer defines business-friendly metrics and dimensions on top of raw warehouse tables. It records which datasets exist, their grain, how they join, and how measures such as revenue or order count should be calculated. This reduces duplicated SQL and helps dashboards, notebooks, and AI analytics tools answer questions with the same definitions.
Start with the warehouse tables or modeled views that analysts will query.
Write the row-level meaning for each dataset, such as one row per order or one row per customer.
Add descriptive dimensions and numeric measures with their SQL expressions and aggregations.
Connect datasets and note the join condition and relationship type.
Use the YAML and SQL preview as a planning artifact before implementing the model in your stack.
semantic_layer:
datasets:
- name
table
grain
dimensions[]
measures[]
joins:
- from
to
on
relationshipThe generated YAML separates descriptive dimensions from aggregated measures and keeps join rules explicit. That mirrors the structure used by many analytics modeling systems while staying generic enough for planning.
Reference: dbt - Semantic Layer
| Requirement | Semantic model |
|---|---|
Revenue dashboard | Orders dataset with revenue, order count, order date, and customer segment Keeps finance and growth dashboards on the same metric definition. |
Customer health reporting | Accounts joined to subscriptions, invoices, tickets, and usage events Makes join assumptions visible before dashboard work starts. |
Self-serve analytics | Curated dimensions and measures exposed to BI users Reduces repeated SQL and ambiguous field names. |
정확한 오류 라인 및 열 보고와 함께 JSON을 포맷, 검증 및 축소합니다.
Drop multiple CSV files, validate matching headers, merge the rows, analyze columns, and download one clean file.
Sketch entities, relationships, owners, and fields, then export a clean JSON ontology for data and product teams.
Define business terms, metric owners, synonyms, formulas, and approval status before mapping them into a semantic layer.
Last updated