Semantic models define the meanings, relationships, and rules of your data. This allows you to
Defining a semantic layer provides consistent definitions that are used across users, ensuring everybody at the organization is seeing that same calculation. It also can ‘bound’ the results to match certain criteria.
This consistency allows a data engineer or data team to specify the data model and then whenever somebody wants to ask questions on top of the data, they are using the set of relationships and metrics that have been pre-created and vetted by the data team.
This provides more control over BI outputs and is particularly relevant for larger organizations where there may be many tables, and leaving users to their own devices to join the right tables or calculate complex metrics on their own is error-prone.
dbt (Data Built Tool) is a widely used tool for data transformations and semantic modelling, allowing SQL-based transformations to clean, aggregate, and structure raw data into meaningful datasets. Models are specified in YAML files where you:
These various individual model YAML files get built into a manifest.json file which Zing pulls from to apply the relationships outlined in the dbt model.
A dbt model defines the relevant tables, calculations, and relationships which can be easily re-used by all the data users in your organization. For example, you could define a metric of revenue_growth_mom to ensure this calculation is visible in Zing is used whenever a user asks for this metric:
"metric.jaffle_shop.revenue_growth_mom": {
"name": "revenue_growth_mom",
"resource_type": "metric",
"package_name": "jaffle_shop",
"path": "marts/order_items.yml",
"original_file_path": "models/marts/order_items.yml",
"unique_id": "metric.jaffle_shop.revenue_growth_mom",
"fqn": ["jaffle_shop", "marts", "revenue_growth_mom"],
"description": "Percentage growth of revenue compared to 1 month ago. Excluded tax",
"label": "Revenue Growth % M/M",
"type": "derived",
"type_params": {
"measure": null,
"input_measures": [
{
"name": "revenue",
"filter": null,
"alias": null,
"join_to_timespine": false,
"fill_nulls_with": null
}
],
"numerator": null,
"denominator": null,
"expr": "(current_revenue - revenue_prev_month)*100/revenue_prev_month",
"window": null,
"grain_to_date": null,
"metrics": [
{
"name": "revenue",
"filter": null,
"alias": "current_revenue",
"offset_window": null,
"offset_to_grain": null
},
{
"name": "revenue",
"filter": null,
"alias": "revenue_prev_month",
"offset_window": { "count": 1, "granularity": "month" },
"offset_to_grain": null
}
],
"conversion_type_params": null
},
"filter": null,
"metadata": null,
"meta": {},
"tags": [],
"config": { "enabled": true, "group": null, "meta": {} },
"unrendered_config": {},
"sources": [],
"depends_on": { "macros": [], "nodes": ["metric.jaffle_shop.revenue"] },
"refs": [],
"metrics": [],
"created_at": 1737750035.73119,
"group": null
},
If you connecting to your dbt semantic model, Zing will read this in and use it to surface metrics, and adhere to the model structure of the connected model.
To do this, go to console then
Click on the data source tab
Click on ‘Settings’
Click on ‘Semantic model’
Click ‘Add semantic model’
Select your manifest.json from your dbt project
Hit ‘Save’
Note the applying the constraints of a semantic model is optional, and is turned on via the Console.
If you only have a few definitions or calculations you’d like to define, you can use the existing aliases and examples capabilities of Zing, which may be easier to use for users without an existing dbt project configured.
Get started with Zing for free! Sign In or create a New Account.
Available on iOS, Android, and the web
Learn how Zing can help you and your organization collaborate with data
Schedule Demo