Skip to main content

Hi everyone,

I need help applying a recurring calculation to a monthly metric in Pigment.

Here’s the situation:

  • I have a metric called RES_Active Doctors, and I want to apply month-by-month the percentage stored in IN_Churn Existing Doctors - 3YP.
  • The calculation should use the value of the previous month as the base.

For example:

  • If the initial value of RES_Active Doctors in Month 1 is 100, and the percentage in IN_Churn Existing Doctors - 3YP is 10%:
    • Month 1: 100 (initial value)
    • Month 2: 90 (100 - 10%)
    • Month 3: 81 (90 - 10%)
    • Month 4: 72.9 (81 - 10%)
    • And so on.

I’m wondering how to model this type of calculation in Pigment. Is there a function or method to automate this logic by referencing the previous period?

Thanks a lot for your help! 😊

Hi ​@MaxenceGoig ,

You can use the PREVIOUS(Month) function to solve this :

PREVIOUS(Month)*(1-'IN_Churn Existing Doctors - 3YP')

 

 

Let me know if that helps,


Hi ​@CDALMAY 

Thank you for your help


Reply