A normal BEGBALCALCYTD will always pull the prior ending balance into all periods of the current year. This is typically done with an IF statement where if period 1 of the current year, it will pull the ending balance of the prior year. Then IF periods 2 – 12 of the current year it can simply look back at period 1 of the current year. And this is normally a member formula found in your Flow dimension.
This is done for efficiency reasons. You only want to look back at prior year once, in period 1. Then in periods 2 – 12 you can simply pull that forward from period 1. This is more efficient than every period in the current year having to look back at prior year.
Here is that sample code, in a very simple form:
Dim PeriodNum As Integer = api.Time.GetPeriodNumFromId(api.Pov.Time.MemberId)
If PeriodNum = 1 Then
api.Data.Calculate("F#BEGBALCALCYTD = RemoveNoData(F#ENDBAL:T#PovPriorYearM12)")
Else
api.Data.Calculate("F#BEGBALCALCYTD = RemoveNoData(F#ENDBAL:T#PovPrior)")
End If
But is sounds like what you may want is a periodic BEGBALCALCMTD calculation instead. This is one where each period simply needs to refer to the prior period’s ending balance. This is not standard for a normal cash flow and beginning balance calculation, but you can add a member called BEGBALCALCMTD or BEGBALCALCPERIOD and get this calculation to work.
It would be something like this:
api.Data.Calculate("F#BEGBALCALCMTD = RemoveNoData(F#ENDBAL:T#PovPrior)")