LOD basics
What's an LOD field?
What's an LOD field?
In a standard query, an aggregation is computed at the granularity of whatever dimensions are in the
GROUP BY clause. Add a dimension and the aggregation regroups; remove one and it regroups again.An LOD field opts out of that behavior. You define the granularity once — for example, “per user” or “across the whole dataset” — and the value persists regardless of the dimensions in the query.Can you explain an LOD using SQL?
Can you explain an LOD using SQL?
LODs can be mapped directly to a SQL equivalent.Consider the following example, a The Omni definition for this LOD dimension would look like the following:The
max_age_in_country LOD dimension that finds maximum user age within each country and attaches it to every user row.SQL
Omni model YAML
fixed: [country] clause corresponds to the GROUP BY country in the inner query — one row per country, the level of detail. The join then carries that country-level value back to each user row, which is why the LOD behaves like a categorical dimension: every user in the same country shares the same max_age_in_country value.Why are LOD fields useful?
Why are LOD fields useful?
LOD fields are useful any time you need a metric at a different grain than the rest of your analysis, for example:
- A customer-level total used while breaking out by product category
- A first-touch date used while analyzing activity over time
- A grand total used while showing per-region values
Can LODs be created as dimensions?
Can LODs be created as dimensions?
Yes. When used as a dimension, an LoD produces a categorical value — one row per level of detail — which lets you perform an additional layer of aggregation (e.g., average customer lifetime spend).
Can LODs be created as measures?
Can LODs be created as measures?
Yes. When used as a measure, an LoD produces an aggregation of an aggregation, such as an average of averages or a percent of total.
Requirements
To create an LOD field, you’ll need Querier, Modeler, or Connection Admin permissions.Creating a level of detail field
You can create an LOD field directly from the field browser in a workbook or in the model IDE.In the workbook
In the workbook
1
Open the level of detail editor
- In the field browser of a query tab, hover over a dimension and click the icon that appears.
- Select Modeling > New level of detail field.
- Enter a display name for the field in the Field Label field.
2
Set the aggregation
Use the Aggregation dropdown to choose an aggregate type, such as
Count distinct.3
Choose a grouping strategy
Use the Level of Detail Grouping and Dimension(s) fields to pick a strategy and the dimensions that define your level of detail. See Grouping strategies below for more information.
4
Define optional fields
You can also add filters, define the field’s scope, and add a description and group label.
5
Save the field
Click Add to save the field. It appears in the field browser under your custom dimensions and behaves like any other field.
In the IDE
In the IDE
You can create LOD measures and dimensions in the model IDE with the See the
level_of_detail parameter. For example:LOD dimension definition
level_of_detail parameter references for measures and dimensions for the full list of supported parameters.Promote the LOD field to the shared model to make it accessible in new and existing workbooks built on the model.
Grouping strategies
Three strategies control how the LOD field interacts with the dimensions in your query:Common patterns
A few LOD patterns come up often enough that they’re worth recognizing on sight. Each example below shows the same field built two ways — the workbook editor inputs and the equivalent YAML in the model IDE — so you can pick whichever surface you’re working in.Customer lifetime spend
Calculate the total spend per customer so you can bucket customers ($0–100, $100–500, etc.) even while viewing orders by product category.
- Workbook
- Omni YAML
The fields in the LOD editor would look like the following:
- Field to aggregate -
Sale price - Aggregation -
Sum - Level of Detail Grouping -
Fixed - Fixed dimension(s) -
User ID
First-touch cohort date
Find each user’s first order date so you can group users into acquisition cohorts.- Workbook
- Omni YAML
The fields in the LOD editor would look like the following:
- Field to aggregate -
Order date - Aggregation -
Min - Level of Detail Grouping -
Fixed - Fixed dimension(s) -
User ID
Percent of total
Calculate the grand total of a metric so you can compare each row’s value to the total — for example, what percentage of total sales each region represents. The result is the company-wide total attached to every row, ready to divide against.- Workbook
- Omni YAML
The fields in the LOD editor would look like the following:
- Field to aggregate -
Sales - Aggregation -
Sum - Level of Detail Grouping -
Exclude - Fixed dimension(s) -
Region

