Skip to main content
Newcomer
February 10, 2022
Solved

Prior/Current Month Dynamic Calculation

  • February 10, 2022
  • 1 reply
  • 0 views

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

 

Best answer by Avatar-Roku

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

1 reply

Avatar-RokuAuthorAnswer
Newcomer
February 10, 2022

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