Finance: Daily Revenue
An account that calculates Daily Revenue by taking three months of Total Revenue and dividing it down to a daily amount
'Calculate Daily Revenue
'Get Text1 priority from current Scenario to learn which Scenario to copy prior data from
Dim priorScenario As String = api.Scenario.Text(api.Pov.Scenario.MemberPK.MemberId, 1)
Dim srcPov As String = "A#YourTotalRevenueAccount:F#Top:I#Top:V#Periodic"
Dim srcInputs As String = String.Empty
Select Case Right(api.Pov.Time.Name, 2)
Case "M1"
srcInputs = srcPov & ":S#" & priorScenario & ":T#PovPriorYearM11 +" & _
srcPov & ":S#" & priorScenario & ":T#PovPriorYearM12 +" & _
srcPov
Case "M2"
srcInputs = srcPov & ":S#" & priorScenario & ":T#PovPriorYearM12 +" & _
srcPov & ":T#PovPrior1 +" & _
srcPov
Case Else
srcInputs = srcPov & ":T#PovPrior2 +" & _
srcPov & ":T#PovPrior1 +" & _
srcPov
End Select
api.Data.Calculate("A#YourDailyRevenueAccount:F#None:I#None:V#YTD = (((" & srcInputs & ")/3)*12/365)")
Published 3 years ago
Version 1.0