Forum Discussion

Montreux's avatar
Montreux
New Contributor III
3 years ago
Solved

How to calculate when accounts have different settings for No Data Zero View for NonAdjustments

I want to run a simple calculation setting one account equal to another.  Account A = Account B.  Account A, the account receiving the data in the calculation, is set to at the member level to YTD for No Data Zero View for NonAdjustments.  The account with the data is set to Periodic.

The problem is when Account B has data for some months and then has a calculated 0 in later months.  The Account A with the YTD setting just replicates the last period's data in the months with 0 in Account B which causes the two accounts not to be equal.  

I am using the following calculation.

api.Data.Calculate("A#AccountA = A#AccountB" , True)

How is this normally managed?

  • That behavior depends on Account Type - Flows will work differently from Assets/Liabilities. Determine which account types you have for A and B, and then when copying data specify the View member you're actually interested in copying.

  • Not ideal, but so long as it is just an exceptional case for a few accounts, then you could always do a calculate that adds the value of T#PovPrior1 (if it's not the first period) on the target account, effectively doing a periodic calculation:
    e.g.
    if api.Time.IsFirstPeriodInYear() then
      api.Data.Calculate("A#AccountA = A#AccountB" , True)
    else
      api.Data.Calculate("A#AccountA = A#AccountA:T#PovPrior1 + A#AccountB:V#Periodic" , True)
    end if

    obviously not particularly efficient since it has to open the previous period's data unit into memory (but that's how periodic views work anyway).   A more flexible option would be to open databuffers and test properties such as 
    If api.Account.GetNoDataZeroViewForNonAdj( accountId ) = ViewMember.Periodic Then ...

    and as JackLacava said, be careful about the switching behaviour on the Flow members.

2 Replies

  • JackLacava's avatar
    JackLacava
    Community Manager

    That behavior depends on Account Type - Flows will work differently from Assets/Liabilities. Determine which account types you have for A and B, and then when copying data specify the View member you're actually interested in copying.

  • ChrisLoran's avatar
    ChrisLoran
    Valued Contributor

    Not ideal, but so long as it is just an exceptional case for a few accounts, then you could always do a calculate that adds the value of T#PovPrior1 (if it's not the first period) on the target account, effectively doing a periodic calculation:
    e.g.
    if api.Time.IsFirstPeriodInYear() then
      api.Data.Calculate("A#AccountA = A#AccountB" , True)
    else
      api.Data.Calculate("A#AccountA = A#AccountA:T#PovPrior1 + A#AccountB:V#Periodic" , True)
    end if

    obviously not particularly efficient since it has to open the previous period's data unit into memory (but that's how periodic views work anyway).   A more flexible option would be to open databuffers and test properties such as 
    If api.Account.GetNoDataZeroViewForNonAdj( accountId ) = ViewMember.Periodic Then ...

    and as JackLacava said, be careful about the switching behaviour on the Flow members.