Cohort Analysis

Cohort reporting can provide valuable feedback about the customers, users, or other groups that share a common element. Cohort reports track groups to see how their data is affected over time. For example, you can create cohort reports to track subscriptions grouped by signup date to study the rates of retention over time.

This intermediate tutorial assumes some knowledge of MAQL. For more information, see MAQL - Analytical Query Language.

For subscription metrics, cohort reports typically show the percentage retained during specific time periods, which can be found using this calculation:

(recurring subscribers) / (number of subscribers in cohort)

The following example shows retention rates in a dummy dataset:

Retention Rates in a Dummy Dataset

This tutorial describes how to create a similar cohort report for subscription metrics in the Portal. The use case and metrics provided in this example use the following LDM:

Cohort Analysis LDM

Suppose subscribers, tracked by their Id, sign up during the Sub Date and then either stay subscribed (Resub = 1), or cancel (Resub = 0).


  1. Determining the cohorts: For this metric, subscribers must be grouped together with a relevant subscription by their Sub Date month in a new Cohort metric.

    SELECT COUNT(Id, Records of Cohort Testing) BY Month/Year (Sub Date), ALL OTHER

    The syntax BY Month/Year ALL OTHER is important in this metric because it essentially “locks” the cohort, so the same group is followed during subsequent periods.

  2. Finding recurring subscribers: The next metric counts the number of subscribers who stayed subscribed during the month by checking all the records where Resub = 1. When sliced by Month/Year of re-subscription, the Recurring Subscribers metric shows a count specific to that month.

    SELECT COUNT(Id, Records of Cohort Testing) WHERE Resub = 1
  3. Tabulate the percentage: The final step is to divide the metrics created in the previous steps to create the % Recurring metric.

    SELECT Recurring Subscribers / Cohort
  4. Optional: You can apply conditional formatting to display a different color based on the percentage. The conditional formatting applied to the % Recurring metric is the following:


For more information, see Conditional Number Formatting.