cancel
Showing results for 
Search instead for 
Did you mean: 

Prior/Current Month Dynamic Calculation

Mustafa_A
Contributor II

Good morning All,

How do I make build this dynamic calculation for my Monthly Rate KPI CV?  It takes the new month and divides it by the previous trailing month (e.g. Jan-21/Dec-20, Feb-21/Jan-21....)

Mustafa_A_0-1644511998603.png

Mustafa_A_1-1644512027064.png

 

Here is the code I wrote:

Dim RentalRevenue As Decimal = api.Data.GetDataCell("A#NetIncome:U4#[Rental Revenue]").CellAmount

Dim RentalRevenueTrailing1Mo As Decimal = api.Data.GetDataCell("A#NetIncome:U4#[Rental Revenue].Prior1").CellAmount

Return RentalRevenue/RentalRevenueTrailing1Mo

 

Any ideas will be appreciated. Thank you.

 

Best,

Mustafa A

 

1 ACCEPTED SOLUTION

Mustafa_A
Contributor II

No response needed. I figured it out.

Needed to add "POVPrior1Month" to gab the prior period. Here is the modified code

Dim RentalRevenue As Decimal = api.Data.GetDataCell("A#NetIncome:U4#[Rental Revenue]:S#Actual").CellAmount
Dim RentalRevenueTrailing1Mo As Decimal = api.Data.GetDataCell("A#NetIncome:U4#[Rental Revenue]:S#Actual:T#POVPrior1").CellAmount

Return RentalRevenue/RentalRevenueTrailing1Mo - 1

View solution in original post

1 REPLY 1

Mustafa_A
Contributor II

No response needed. I figured it out.

Needed to add "POVPrior1Month" to gab the prior period. Here is the modified code

Dim RentalRevenue As Decimal = api.Data.GetDataCell("A#NetIncome:U4#[Rental Revenue]:S#Actual").CellAmount
Dim RentalRevenueTrailing1Mo As Decimal = api.Data.GetDataCell("A#NetIncome:U4#[Rental Revenue]:S#Actual:T#POVPrior1").CellAmount

Return RentalRevenue/RentalRevenueTrailing1Mo - 1