Dimensions and Measures
Define fields and their properties in your semantic layer
Dimensions and measures form the foundation of your semantic layer, defining the fields that can be used for filtering, grouping, and aggregation.
Dimensions
Dimensions represent the descriptive attributes or characteristics of your data. They are typically non-numeric or categorical fields used to slice, dice, group, and filter data. Think of them as the “who, what, where, when, why” of your analysis. Examples include dates, user IDs, product categories, geographical locations, or status flags.
Required Fields
- name: The field name, typically matching a column name in your database. It should represent a specific attribute of the model’s entity.
- description: A clear explanation of what the dimension represents. This is mandatory.
Optional Fields
- type: The data type of the dimension. Defining the correct type (e.g.,
date
,timestamp
,boolean
,string
) is crucial for proper handling and analysis. - searchable: Whether this dimension can be used in search queries. Defaults to
false
. - options: A list of allowed values for this dimension, useful for categorical data.
Dimension vs. Filter: While a boolean dimension (e.g., is_active
) can be used for filtering, its primary purpose is to describe an attribute of the entity (e.g., the user is active). A dedicated Filter, on the other hand, defines a specific condition or subset (e.g., active_users_last_30_days
). If a boolean concept represents a core attribute, define it as a dimension. If it represents a common filtering condition, especially one involving logic beyond a single column, define it as a Filter. See Defining Filters.
Measures
Measures are quantitative fields that can be aggregated, such as quantities or amounts.
Required Fields
- name: The field name, typically matching a column name in your database
- description: A clear explanation of what the measure represents. This is mandatory.
Optional Fields
- type: The data type of the measure
Best Practices
Descriptive Names
Use clear, business-oriented names that convey meaning.
Add Descriptions
Include detailed descriptions to help Buster understand the context.
Set Data Types
Explicitly setting types ensures proper handling of values.
Include Units
Mention units of measurement in descriptions (e.g., “in USD”, “in days”).
Example
Next Steps
Now that you’ve defined dimensions and measures, you can:
- Create metrics for business calculations
- Establish relationships between models