A cohort is a group of people (users, customers, visitors) usually defined by year and month. Cohort analyses look at how long these people are retained and changes in their activity over time.
For example, if you are an analyst for a phone provider, you might want to predict a customer's phone usage rate and how long customers will use your provider. You can't use calendar months to track results because customer sign up dates differ and the nth month or lifetime month is needed to calculate results.
This tip will instruct you on how to create a cohort report for analyzing different results over time.
Skill level : Beginner
Time required : 15 minutes
- Four calculated attributes
- One result path calculation
- Two metrics, one color encoded
Creating your report
- Sign up date: A single date of the earliest contact. This could be registration, sign up, contract subscription, etc. The sign up date field in the examples below is 'registrationdate'.
- Transaction date: Multiple dates containing the relevant activity. Transaction dates could be for monthly payments, daily usage, etc. The transaction date field in the examples below is 'transactiondate'.
To create your report
- Connect to the data source containing your cohort data (see Adding connections ).
- In the Query Builder, click the Calculation engine icon.
- Select Standard calculated attribute .
Create the following four calculated attributes by typing directly into the formula box.
M"+(NUMBER([Month Diff])+(12*NUMBER([Year Diff]))+1)
This creates a label where the first month is M1, second M2, third M3, and so on. If you want to start at 0, remove the +1 from your formula.
- On Metrics, click the + button to add a new metric.
Select the metric you want to use in your analysis. For example, a phone provider would select a usage metric to track how frequently customers use their phones.
On Columns, click the
button to add a new attribute, then select the Nth month calculated attribute.
- On Rows, click the + button to add a new attribute, then select the Cohort attribute.
Your report should now resemble the image below. If you would like to perform other calculations, such as the usage percentage over time against the first month, you can follow the steps in the section below.
Customizing your cohort report
This section will instruct you on how to customize your report and create result manipulations to further analyze data.
To customize your report
- In the Visualization type menu, select the table chart.
button to add a second metric to your query. You will need to add a second metric differently depending on whether your analysis measure was imported from your dataset or created using the calculation engine.
- If your metric was imported from your dataset, add the same metric, but with the SUMX aggregator. You can select a different aggregator by clicking the arrow next to a metric's name. The SUMX aggregator will give you the same results as SUM.
- If your metric was created in the calculation engine, you will need to duplicate the metric using the same formula. You can then add the duplicated metric to your query.
- Click on your second metric.
- Click the Color button at the bottom of the menu. Your metric will then become a color encoded metric.
- On Metrics, add a new color encoded metric by clicking the color encoded metric icon ( ).
- In the Result manipulation menu, select Result path calculation .
To calculate the % usage or retention over time, select the following options for your color encoded metric. For more information on using result path calculations, see
Creating result path calculations
- From the Pattern drop-down list, select % .
- From the Path drop-down list, select On columns .
drop-down list, select
- Click Apply when finished.
- In the Chart configuration menu, select Colors > Color encoding to customize the color gradient for your metric.
You have now successfully created your cohorts report.