GROUP BY. For example, you may want to show each customer’s lifetime spend on a row-level breakout by product category, or compute each region’s percentage of a grand total. Omni gives you four ways to handle these: an LOD field, a SQL window function, a CTE or derived table, or a spreadsheet.
In this guide, you’ll learn about each of these methods, how they compare to each other, and when to choose each one.
Before you start
If you’re new to LOD fields, read Level of detail fields first — this guide assumes basic familiarity with the field type.Available methods
The right choice usually comes down to whether the calculation needs to be reusable, where you’re comfortable writing logic, and how much data is involved. Use the table below as a starting point; the side-by-side comparison goes deeper on the trade-offs.Comparing methods
This table compares the four methods across the traits that usually drive the choice. Use it when you want to compare a specific dimension across all four options.Common scenarios
The three scenarios below cover the patterns that come up most often: bucketing customers by lifetime spend, building acquisition cohorts, and computing percent of total. Each is solved with all four methods side by side, so you can take a pattern you already know in one tool and find its equivalent in another.Customer lifetime spend
In this scenario, you want “total spend per customer” as a dimension you can use to bucket customers ($0–100, $100–500, and so on), even when viewing orders by product category.
- Omni LOD
- SQL window function
- CTE
- Excel
The fields in the workbook’s 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
In this scenario, you want each user’s first order date so you can analyze performance by acquisition cohort.- Omni LOD
- SQL window function
- CTE
- Excel
The fields in the workbook’s 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
In this scenario, you’re viewing sales by region and want to know what percentage of the company’s total sales each region represents.- Omni LOD
- SQL window function
- CTE
- Excel
The fields in the workbook’s LOD editor would look like the following:
- Field to aggregate -
Sales - Aggregation -
Sum - Level of Detail Grouping -
Exclude - Fixed dimension(s) -
Region
Next steps
- Create your first LOD field in a workbook
- Build a cohort analysis using an LOD field
- Promote logic to a derived table or query view
- Read Omni’s blog post on level of detail fields

