11-10-2022 05:26 AM - last edited on 05-02-2023 10:51 AM by JackLacava
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?
Solved! Go to Solution.
11-14-2022 07:14 AM
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.
11-28-2022 06:29 AM - edited 11-28-2022 06:52 AM
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.
11-14-2022 07:14 AM
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.
11-28-2022 06:29 AM - edited 11-28-2022 06:52 AM
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.