0
0
Tableaubi_tool~7 mins

Common LOD use cases (customer first purchase, cohorts) in Tableau - Step-by-Step Guide

Choose your learning style9 modes available
Introduction
Level of Detail (LOD) expressions in Tableau help you calculate values at different levels of detail than the view. This is useful when you want to find things like a customer's first purchase date or group customers into cohorts based on their first purchase.
When you want to find the first purchase date for each customer regardless of the current view filters.
When you need to create customer cohorts based on the month or year of their first purchase.
When you want to calculate metrics like retention or repeat purchases by cohort.
When you want to compare individual transactions to overall customer behavior.
When you want to fix a calculation at the customer level while showing data at a more detailed level.
Steps
Step 1: Open
- Tableau Desktop and connect to your data source
Your data appears in the Data pane
Step 2: Click
- Analysis menu > Create Calculated Field
A dialog box opens to create a new calculation
Step 3: Type
- Calculated Field dialog
You enter the LOD expression for first purchase date
💡 Use syntax like { FIXED [Customer ID] : MIN([Order Date]) } to get the first purchase date per customer
Step 4: Name
- Calculated Field dialog
You name the field 'Customer First Purchase Date'
💡 Choose clear names to remember what the calculation does
Step 5: Click
- OK button in Calculated Field dialog
The new calculated field appears in the Data pane
Step 6: Drag
- New calculated field to Rows or Columns shelf or Detail on Marks card
You see the first purchase date for each customer in your view
Step 7: Repeat
- Create Calculated Field dialog
You create cohort groups using a calculation like DATEPART('month', [Customer First Purchase Date])
💡 Use this to group customers by the month they made their first purchase
Before vs After
Before
View shows all orders with order dates and customer IDs but no summary of first purchase dates
After
View shows each customer with their first purchase date fixed, enabling cohort grouping and analysis
Settings Reference
FIXED LOD expression
📍 Calculated Field dialog
Calculates a value fixed at the specified dimension level regardless of view filters
Default: None
INCLUDE LOD expression
📍 Calculated Field dialog
Includes additional dimensions in the calculation beyond the view level
Default: None
EXCLUDE LOD expression
📍 Calculated Field dialog
Excludes specified dimensions from the calculation
Default: None
Common Mistakes
Using a regular aggregation like MIN([Order Date]) without FIXED LOD
This calculates the minimum date in the current view, which changes with filters and does not fix per customer
Use { FIXED [Customer ID] : MIN([Order Date]) } to get the first purchase date per customer regardless of filters
Creating cohorts without fixing the first purchase date
Cohorts will be inconsistent because the first purchase date changes with the view
Create a fixed LOD for first purchase date, then use that field to define cohorts
Summary
LOD expressions let you calculate values fixed at a specific level, like customer first purchase date.
Use FIXED LOD to get stable values regardless of filters or view level.
This helps create cohorts and analyze customer behavior over time.