Skip to main content
Solved

Cohort framework & Previous question

  • December 6, 2022
  • 5 replies
  • 215 views

Trever Leavenworth
Master Trendsetter
Forum|alt.badge.img+5

Hey everyone!

 

I’m trying to create a cohort framework in the backend of the model. To do this, I’m using my Datahub::Month dimension and my Revenue app::Cohort Months dimension. It should generate something like:

                    0             1             2

Jan 23    Jan 23     Feb 23    Mar 23

Feb 23   Feb 23     Mar 23    Apr 23

Mar 23   Mar 23     Apr 23    May 23

 

and so on.

 

Is this the best practice to enable cohort logic for things like churn?

 

To create my Cohort Months dimension, I can manually type integers 0 through 60 for example, but is there a way to use PREVIOUS() to just increment 1 each row to do this? Screenshot:

 

 

Best answer by Ben A

Hi Trever ! 
Yes, it’s still best practice to do this 🙂
Regarding your first question, you can automatically populate the cohort month number with a formula of this type: CUMULATE(1, ‘Revenue Cohort Month’)   

Previous only works on metrics. 

For your second formula: 
Month + ‘Revenue Cohort Month’.’Cohort Month’ should be enough

5 replies

Trever Leavenworth
Master Trendsetter
Forum|alt.badge.img+5
  • Author
  • Master Trendsetter
  • 12 replies
  • December 6, 2022

Screenshot of the cohort matrix I’ve produced re: is this best practice question above

 

 


Ben A
Employee
Forum|alt.badge.img+3
  • Employee
  • 13 replies
  • Answer
  • December 6, 2022

Hi Trever ! 
Yes, it’s still best practice to do this 🙂
Regarding your first question, you can automatically populate the cohort month number with a formula of this type: CUMULATE(1, ‘Revenue Cohort Month’)   

Previous only works on metrics. 

For your second formula: 
Month + ‘Revenue Cohort Month’.’Cohort Month’ should be enough


Trever Leavenworth
Master Trendsetter
Forum|alt.badge.img+5
  • Author
  • Master Trendsetter
  • 12 replies
  • December 6, 2022

Merci bcp @Ben A!


Trever Leavenworth
Master Trendsetter
Forum|alt.badge.img+5
  • Author
  • Master Trendsetter
  • 12 replies
  • December 6, 2022

@Ben A the CUMULATE(1, ‘Revenue Cohort Month’) starts at 1, is there a way to zero-index?


Ben A
Employee
Forum|alt.badge.img+3
  • Employee
  • 13 replies
  • December 6, 2022

Of course, you can simply add a -1 afterwards