Define fields and their properties in your semantic layer
Field | Required | Description |
---|---|---|
name | Yes | Unique name for the dimension within the model. Typically matches a column name. |
description | Yes | A human-readable description of the dimension. This is mandatory. |
type | Yes | The raw data type from the underlying database or data warehouse (e.g., VARCHAR , INT , TIMESTAMP ). |
searchable | No | Indicates if this dimension should be indexed for searching. Defaults to false if omitted. |
options | No | A list of predefined string values for this dimension, useful for categorical data. |
Field | Required | Description |
---|---|---|
name | Yes | Unique name for the measure within the model. Typically matches a column name. |
description | Yes | A human-readable description of the measure. This is mandatory. |
type | Yes | The underlying column type as defined in the database/warehouse. Supported aggregation types depend on the query engine. |
orders
semantic model. This model represents data about customer orders.
dimensions
:
order_id
: This is a classic dimension. While it might be numeric or a string, its primary purpose is identification, not calculation. You use it to find specific orders.customer_id
: This is a classic dimension. While it might be numeric or a string, its primary purpose is identification, not calculation. You use it to find specific orders.order_date
: Dates are dimensions because they provide context (when something happened). You use them to filter (“orders this week”) or group (“revenue by month”). Making it searchable: true
optimizes queries that filter by this date.status
: This is categorical text. It describes the state of an order. You use it to group (“count of orders by status”) or filter (“show only ‘shipped’ orders”). The options
list helps ensure data consistency and can populate UI elements.measures
:
amount
: This is a core measure. It’s a numeric value representing how much. You’ll typically perform mathematical operations on it, like SUM(amount)
for total revenue or AVG(amount)
for average order value. The description clarifies the unit (USD).item_count
: Similar to amount
, this is a numeric value representing how many. It’s meant for aggregation like SUM(item_count)
to find the total number of items sold.