Forum Discussion

ZubairCSC's avatar
ZubairCSC
New Contributor II
2 years ago

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 shar...
  • EricOsmanski's avatar
    2 years ago

    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 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
     
    If currView.Name = "YTD" Then
    Return api.Data.GetDataCell("A#Cash:F#EndBal:T#PovPriorYearM12")
    Else If currView.Name = "Periodic" Then
    Return api.Data.GetDataCell("A#Cash:F#EndBal:T#PovPrior1")
    Else If currView.Name = "QTD" Then
    Return api.Data.GetDataCell("A#Cash:F#EndBal:T#[" + priorQtrName + "]")
    Else
    Return Nothing
    End If