Skip to main content
Solved

How to apply a recurring calculation on a metric with a monthly dimension ?

  • December 10, 2024
  • 2 replies
  • 153 views

Forum|alt.badge.img+1

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! 😊

Best answer by CDALMAY

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,

2 replies

CDALMAY
Master Helper
Forum|alt.badge.img+14
  • Master Helper
  • Answer
  • December 10, 2024

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,


Forum|alt.badge.img+1
  • Author
  • Apprentice Helper
  • December 12, 2024

Hi ​@CDALMAY 

Thank you for your help