Overview
Background
Cohort analysis groups users by their shared purchase characteristics. For example, you can group clients by their first purchase year.
Compare the yearly sales contribution of clients who have done their first purchase in different years to figure out which year attracted the most clients and performed the best.
Preview
The following bar chart displays the sales contribution of each group, through which it is obvious that the clients who have done their first purchase in 2013 contributed the most.
The chart also exposes a downward trend in the sales contribution of new clients over time.
For online preview, click Cohort Analysis.
You can click Save as subject to make this chart by yourself or view the editing steps.
Procedures
Adding Data
Sample data: Supermarket Sales Data.xlsx
Create a subject and upload the sample data, as shown in the following figure.
Creating a Component
To group clients by their first purchase year, you need to calculate in which year did they make their first purchase.
Calculating the First Purchase Time
Add a calculation indicator and use the DEF function to calculate the first purchase time of clients, as shown in the following figure.
Formula:DEF(MIN_AGG(order date), client's name)
Formula | Description | Function Reference |
---|---|---|
DEF(MIN_AGG(order date), client's name) | Calculate the first purchase date of clients based on their names. |
Creating a Column Chart
1. Set the chart type as Stacked Column Chart. Drag the Order Date field into the horizontal axis, and the Sales field into the vertical axis. Change the grouping method of Order Date to year, as shown in the following figure.
2. Drag the First Purchase Time field into Color and change its grouping method to year. In this way, the sales contributed by clients with different first purchase time in each column will be displayed in different colors.
Drag the Sales field into Label and change its quantity unit to million to display specific values.
Demonstration
For the demonstration of this chart, see section "Preview".