You are on page 1of 6

Tableau Training and Certification www.edureka.

co/tableau-training-for-data-visualization

Module 8: LOD Problem Set


Solution

© Brain4ce Education Solutions Pvt. Ltd.


Module 8 – LOD Problem Set www.edureka.co/tableau-training-for-data-visualization

Solutions

Solution 1:
Step 1: Calculate the first date of purchase using LOD as already discussed.

Step 2: Create a calculated field that has the following logic: If the order date is
equal to the day of first purchase for that customer, flag that row as new,
otherwise flag it as existing.

©Brain4ce Education Solutions Pvt. Ltd Page 1


Module 8 – LOD Problem Set www.edureka.co/tableau-training-for-data-visualization

Step3:
Build the visualization:
1) Bring Day of Order Date to Columns.
2) Bring count distinct of Customer ID to Rows.
3) Bring New or Existing to the Filters shelf and keep "New" only.
4) Right-click on the pill on Rows and select add a Quick Table Calculation >
Running Total.
5) Bring Market to Color.

©Brain4ce Education Solutions Pvt. Ltd Page 2


Module 8 – LOD Problem Set www.edureka.co/tableau-training-for-data-visualization

Solution 2:
Step 1: Calculating the first order date for the Customer.

Step 2: The next step is to return the date of all repeat purchases. This
should return the same value as Order Date, but lists “null” for the first
purchase date and any customer who never had a repeat purchase.

©Brain4ce Education Solutions Pvt. Ltd Page 3


Module 8 – LOD Problem Set www.edureka.co/tableau-training-for-data-visualization

Step 3: Calculate Second Order Date

Step 4: Now that we know the first and second purchase dates for each customer,
we can calculate the gap between these dates. Save this calculation and move it
from Measures to Dimensions.

©Brain4ce Education Solutions Pvt. Ltd Page 4


Module 8 – LOD Problem Set www.edureka.co/tableau-training-for-data-visualization

Step 5:
Finally, build the visualization
1. Bring [Quarters to repeat purchase] to Columns.
2. Right-click [Quarters to repeat purchase] on Columns and select Dimension.
3. Right-click [Quarters to repeat purchase] on Columns again and select Discrete.
4. Alias the null values with "lapsed".
5. Bring QUARTER(First Purchase Date) to Rows.
6. Right-click QUARTER(First Purchase Date) on Rows and select Discrete.
7. Bring count distinct of customer ID to Color.

©Brain4ce Education Solutions Pvt. Ltd Page 5

You might also like