ZubairCSC
2 years agoNew Contributor II
Cash Flow Opening balance for MTD and YTD columns
Hi All,
I want to get Last month ending balance in my MTD column of cash flow and last year ending balance in my YTD column of cash flow as you can see in above picture.
Can anybody share with me the business rule? I have tried following business rule but it is capturing only at the end of the year balance.
Dim currView As ViewMember = ViewMember.GetItem(api.Pov.View.MemberPk.MemberId) 'Current view member ID
Dim priorQtr As Integer = api.Time.GetLastPeriodInPriorQuarter(api.Pov.Time.MemberId) 'Prior QTR member ID
Dim priorQtrName As String = api.Time.GetNameFromId(priorQtr) 'Prior QTR name
#End Region
' Bring in Beginning Cash and Ending Cash to the Cashflow hierarchy in Flow
If currView.Name = "YTD" Then
api.data.calculate("F#CF_BegCash" & Target & " = RemoveZeros(F#EndBal:T#PovPriorYearM12" & Source &")","A#CashTot.Base")
Else If currView.Name = "Periodic" Then
api.data.calculate("F#CF_BegCash" & Target & " = RemoveZeros(F#EndBal:T#PovPrior1" & Source &")","A#CashTot.Base")
Else If currView.Name = "MTD" Then
api.data.calculate("F#CF_BegCash" & Target & " = RemoveZeros(F#EndBal:T#PovPrior1" & Source &")","A#CashTot.Base")
End If
api.data.calculate("F#CF_EndCash" & Target & " = RemoveZeros(F#EndBal" & Source &")","A#CashTot.Base")
Please help!
You will want to make this Flow Member to be Dynamic Calc. Here is an example from the CPM Blueprint with can be downlaoded from the Solution Exchange OpenPlace.
Dim currView As ViewMember = ViewMember.GetItem(api.Pov.View.MemberPk.MemberId) 'Current view member IDDim priorQtr As Integer = api.Time.GetLastPeriodInPriorQuarter(api.Pov.Time.MemberId) 'Prior QTR member IDDim priorQtrName As String = api.Time.GetNameFromId(priorQtr) 'Prior QTR nameIf currView.Name = "YTD" ThenReturn api.Data.GetDataCell("A#Cash:F#EndBal:T#PovPriorYearM12")Else If currView.Name = "Periodic" ThenReturn api.Data.GetDataCell("A#Cash:F#EndBal:T#PovPrior1")Else If currView.Name = "QTD" ThenReturn api.Data.GetDataCell("A#Cash:F#EndBal:T#[" + priorQtrName + "]")ElseReturn NothingEnd If