0
0
Tableaubi_tool~5 mins

INCLUDE LOD expression in Tableau - Step-by-Step Guide

Choose your learning style9 modes available
Introduction
INCLUDE LOD expressions let you add extra detail to your calculations without changing the view. This helps when you want to see data at a finer level while keeping your main chart simple.
When you want to calculate sales per customer even if your view only shows sales per region.
When you need to count unique products sold per store but your dashboard shows total sales by month.
When you want to find average order size per product category while your chart groups by year.
When you want to add a detail like customer name to a calculation without adding it to the view.
When you want to compare detailed values inside a summary chart without changing the chart layout.
Steps
Step 1: Click
- Analysis menu > Create Calculated Field
A new calculation editor window opens
💡 Use a clear name for your calculation to remember its purpose
Step 2: Type
- Calculation editor
You enter the INCLUDE LOD expression syntax
💡 Start with curly braces and INCLUDE keyword, e.g., { INCLUDE [Customer ID] : SUM([Sales]) }
Step 3: Click
- OK button in the calculation editor
The new calculated field appears in the Data pane
💡 Drag this field into your view to see the detailed calculation
Step 4: Drag
- New calculated field to Rows or Columns shelf
The view updates showing the calculation at the included detail level
💡 You can combine this with other fields to compare different levels of detail
Before vs After
Before
View shows total sales by region only, no detail by customer
After
View shows sales including customer-level detail inside the region totals using INCLUDE LOD
Settings Reference
Calculation Editor
📍 Analysis menu > Create Calculated Field
To write and save custom calculations including INCLUDE LOD expressions
Default: Empty calculation
Data Pane
📍 Left side panel in Tableau workspace
To organize and access all data fields and calculations
Default: Shows all fields and calculations
Common Mistakes
Using INCLUDE without curly braces or colon
Tableau requires exact syntax with braces and colon for LOD expressions
Write INCLUDE LOD as { INCLUDE [Dimension] : AGGREGATION([Measure]) }
Adding fields in the view that conflict with the INCLUDE dimension
This can cause unexpected aggregation or duplicate rows
Keep the view fields separate from the INCLUDE dimension or adjust calculation accordingly
Summary
INCLUDE LOD expressions add extra detail to calculations without changing the view layout.
They help compare detailed data inside summary charts easily.
Remember to use correct syntax with curly braces and colon for INCLUDE expressions.