Bird
Raised Fist0
Tableaubi_tool~15 mins

Common LOD use cases (customer first purchase, cohorts) in Tableau - Real Business Scenario

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Scenario Mode
👤 Your Role: You are a data analyst at an online retail company.
📋 Request: Your manager wants to understand when customers made their first purchase and group customers into monthly cohorts based on that first purchase date.
📊 Data: You have a sales dataset with columns: Customer ID, Order Date, and Sales Amount.
🎯 Deliverable: Create a Tableau dashboard showing each customer's first purchase month and a cohort analysis of monthly customer groups with total sales.
Progress0 / 6 steps
Sample Data
Customer IDOrder DateSales Amount
C0012023-01-15120
C0022023-01-2080
C0012023-02-10150
C0032023-02-25200
C0042023-03-0550
C0022023-03-15100
C0052023-03-20300
C0062023-04-0175
C0032023-04-10125
C0072023-04-1590
1
Step 1: Create a calculated field to find each customer's first purchase date using FIXED LOD expression.
{ FIXED [Customer ID] : MIN([Order Date]) }
Expected Result
For example, Customer C001's first purchase date is 2023-01-15.
2
Step 2: Create a calculated field to extract the first purchase month from the first purchase date.
DATETRUNC('month', [First Purchase Date])
Expected Result
Customer C001's first purchase month is 2023-01-01.
3
Step 3: Create a cohort group by assigning customers to cohorts based on their first purchase month.
Use the First Purchase Month field as the cohort group dimension.
Expected Result
Customers grouped by their first purchase month, e.g., cohort '2023-01' includes C001 and C002.
4
Step 4: Build a view showing cohort groups on rows and order months on columns with SUM of Sales Amount as values.
Rows: First Purchase Month (cohort), Columns: DATETRUNC('month', [Order Date]), Values: SUM([Sales Amount])
Expected Result
A matrix showing sales by cohort over time, e.g., cohort 2023-01 sales in Jan, Feb, Mar, etc.
5
Step 5: Create a line chart showing total sales over time for each cohort to visualize retention and sales trends.
Use First Purchase Month as color, Order Month on X-axis, SUM(Sales Amount) on Y-axis.
Expected Result
Line chart showing how sales from each cohort change month by month.
6
Step 6: Add filters for Order Date range and Customer ID to allow interactive exploration.
Add Order Date filter and Customer ID filter to the dashboard.
Expected Result
User can filter data to specific periods or customers.
Final Result
Cohort Analysis Dashboard

+----------------+----------------+----------------+----------------+
| First Purchase | Jan 2023       | Feb 2023       | Mar 2023       |
| Month (Cohort) | Sales          | Sales          | Sales          |
+----------------+----------------+----------------+----------------+
| 2023-01        | $200           | $150           | $100           |
| 2023-02        |                | $200           |                |
| 2023-03        |                |                | $450           |
| 2023-04        |                |                |                |
+----------------+----------------+----------------+----------------+

(Line chart below showing sales trends by cohort over months)
✓Customers who first purchased in January 2023 generated sales in subsequent months, showing repeat purchases.
✓The February 2023 cohort shows strong sales in its first month but no data beyond that yet.
✓March 2023 cohort has high initial sales, indicating strong new customer acquisition.
✓April 2023 cohort is just starting with initial sales data.
Bonus Challenge

Create a calculated field to compute customer retention rate by cohort month over time.

Show Hint
Use LOD to count distinct customers per cohort and per order month, then divide to find retention percentage.

Practice

(1/5)
1. What is the main purpose of using a Fixed Level of Detail (LOD) expression in Tableau for customer analysis?
easy
A. To calculate the total sales for the current view only
B. To find each customer's first purchase date regardless of filters
C. To change the data source connection
D. To create a new data table outside Tableau

Solution

  1. Step 1: Understand Fixed LOD expression role

    Fixed LOD expressions calculate values at a fixed granularity, ignoring filters that affect the view.
  2. Step 2: Apply to customer first purchase date

    Using Fixed LOD, you can find the earliest purchase date per customer, even if the view filters change.
  3. Final Answer:

    To find each customer's first purchase date regardless of filters -> Option B
  4. Quick Check:

    Fixed LOD finds fixed values like first purchase [OK]
Hint: Fixed LOD fixes calculation level ignoring filters [OK]
Common Mistakes:
  • Confusing Fixed LOD with simple aggregation
  • Thinking LOD changes data source
  • Assuming LOD creates new tables
2. Which of the following is the correct syntax for a Fixed LOD expression to find the first purchase date per customer in Tableau?
easy
A. { FIXED [Customer ID] : MIN([Purchase Date]) }
B. { INCLUDE [Customer ID] : MAX([Purchase Date]) }
C. { EXCLUDE [Customer ID] : SUM([Sales]) }
D. { FIXED [Purchase Date] : COUNT([Customer ID]) }

Solution

  1. Step 1: Identify Fixed LOD syntax

    Fixed LOD uses curly braces with FIXED keyword, then dimension(s), colon, and aggregation.
  2. Step 2: Match expression to find first purchase date

    MIN([Purchase Date]) per [Customer ID] finds earliest purchase date per customer.
  3. Final Answer:

    { FIXED [Customer ID] : MIN([Purchase Date]) } -> Option A
  4. Quick Check:

    Fixed LOD with MIN date per customer = correct syntax [OK]
Hint: Fixed LOD uses { FIXED [Dimension] : Aggregation } [OK]
Common Mistakes:
  • Using INCLUDE or EXCLUDE instead of FIXED
  • Using MAX instead of MIN for first purchase
  • Fixing on wrong dimension like Purchase Date
3. Given the LOD expression { FIXED [Customer ID] : MIN([Purchase Date]) }, what will be the result if a customer has purchases on 2023-01-10, 2023-02-15, and 2023-03-20?
medium
A. NULL
B. 2023-03-20
C. 2023-02-15
D. 2023-01-10

Solution

  1. Step 1: Understand MIN aggregation in LOD

    MIN([Purchase Date]) returns the earliest date for the fixed customer.
  2. Step 2: Identify earliest purchase date

    Among 2023-01-10, 2023-02-15, 2023-03-20, the earliest is 2023-01-10.
  3. Final Answer:

    2023-01-10 -> Option D
  4. Quick Check:

    MIN date per customer = earliest purchase [OK]
Hint: MIN returns earliest date in Fixed LOD [OK]
Common Mistakes:
  • Choosing MAX instead of MIN
  • Confusing date formats
  • Assuming NULL if multiple purchases
4. You wrote this LOD expression to find first purchase date: { FIXED [Customer ID] : MIN([Purchase Date]) }. But the result shows the same date for all customers. What is the most likely error?
medium
A. You forgot to include [Customer ID] in the view or filter context
B. You used MAX instead of MIN
C. You wrote INCLUDE instead of FIXED
D. You used SUM instead of MIN

Solution

  1. Step 1: Check LOD expression correctness

    The expression syntax is correct for Fixed LOD with MIN.
  2. Step 2: Understand why all customers show same date

    If [Customer ID] is not in the view or filter, Tableau aggregates all customers together, showing one date.
  3. Final Answer:

    You forgot to include [Customer ID] in the view or filter context -> Option A
  4. Quick Check:

    Missing dimension in view causes same value for all [OK]
Hint: Always include LOD dimension in view to see distinct results [OK]
Common Mistakes:
  • Changing aggregation instead of checking view
  • Confusing FIXED with INCLUDE
  • Ignoring filter context effects
5. You want to create customer cohorts by their first purchase month using LOD expressions. Which approach correctly assigns each customer to their cohort month?
hard
A. { EXCLUDE [Customer ID] : COUNT([Customer ID]) }
B. { INCLUDE [Customer ID] : MAX([Purchase Date]) }
C. { FIXED [Customer ID] : DATETRUNC('month', MIN([Purchase Date])) }
D. { FIXED [Purchase Date] : MIN([Customer ID]) }

Solution

  1. Step 1: Identify cohort definition

    Cohorts group customers by their first purchase month, so we need first purchase date truncated to month.
  2. Step 2: Use Fixed LOD to get first purchase month per customer

    Fixed LOD with MIN([Purchase Date]) finds first purchase date; DATETRUNC('month', ...) converts it to month start.
  3. Final Answer:

    { FIXED [Customer ID] : DATETRUNC('month', MIN([Purchase Date])) } -> Option C
  4. Quick Check:

    Fixed LOD + DATETRUNC for cohort month = correct [OK]
Hint: Use DATETRUNC with Fixed LOD for cohort month [OK]
Common Mistakes:
  • Using INCLUDE or EXCLUDE instead of FIXED
  • Not truncating date to month
  • Fixing on wrong dimension