Tableau - Customer Aquisition with LOD Expressions

The task is to show customer growth over time for different regions on the macro and micro level.

Step 1: Create a new LOD calculated field in Tableau called "First Purchase Date" and type


                {FIXED [Customer ID]: MIN([Order Date])}
                 

Step 2: Create a calculated field in Tableau called "Customer Type" and type


                IF [First Purchase Date] = [Order Date] THEN 'new' ELSE 'existing' END
                 

Step 3: Add "First Purchase Date" to the column shelf, "Customer ID" to the row shelf and "Customer Type" to Filter. Filter only on "new"

Step 4: For YEAR(First Purchase Date) in the Columns shelf, right click and select the Quarter (the continuous one above week number).

  • Calculation Type: Percentage of Total
  • Compute using: Table (down)

Step 5: Right click on "Customer ID" in the Rows shelf and select:

  • Measure -> Count (Distinct)
  • Quick Table Calculation -> Running Total

Step 6: Drag Market to Color


Adding Drill Down Features


Step 7: Rename the current sheet to Market View and right click and duplicate sheet. Change the new sheet name to Country View. Duplicate again and rename to State View

Step 8: In Country View drag "Country" to color and in State View drag "State" to color.

Step 8: In "Market View" select Worksheet and Actions. Add action as a filter action and in the pop up menu:

  • Name: Market to Country
  • Source Sheets: Market View
  • Target Sheets: Country View
  • Run Action on: Select and run on single select only
  • Clearing Section will: Leave the filter
  • Target Filters: Selected Fields -> Add Filter with Source and Target Field being Market

Step 9: In "State View" select Worksheet and Actions. Add action as a filter action and in the pop up menu:

  • Name: Country to State
  • Source Sheets: Country View
  • Target Sheets: State View
  • Run Action on: Select and run on single select only
  • Clearing Section will: Leave the filter
  • Target Filters: Selected Fields -> Add Filter with Source and Target Field being Country

Tip: When creating a Dashboard you can create similar action filters. Similar Actions need to be recreated at the dashboard level. (ie. Dashboard -> Actions tab up top.) Similarily, create three separate dashboards using Market View, Country View and State View sheets.


Dash-Intel is a Power BI and Tableau resource site for data visualization and building BI dashboards.

Data Analyst & Consultant

Copyright 2015-2023 Dash-Intel.com Terms