Tableau Desktop Certified Associate: Exam Guide
by Dmitry Anoshin, JC Gillet, Fabian Peri, Radhika Biyani, Gleb Makarenko
Example 3 – cohorts
Using the Global Superstore dataset, we want to see how many sales were generated in 2012 for customers (Customer ID) making their first purchase (Order Date) in that year. This is what is usually called a cohort analysis, and is often seen in the exam.
For each customer, we first have to define their earliest date of purchase. To do so, we create a calculated First Order Date field as {FIXED [Customer ID] : MIN([Order Date])}. This will take the earliest Order Date in the entire dataset for each Customer ID.
We can then create a visualization with Year([Order Date]) as columns, Year([First Order Date]) as rows, and SUM([Sales]) as measures. This gives the following:
Customers making their first order in 2012 have therefore ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access