Skip to main content
Contributor
October 14, 2024

Forecast seeding copying derived zeros to a hard zero from calculate

  • October 14, 2024
  • 1 reply
  • 0 views

Using the below rule it seems my derived Zeros are being copied as real data zeros as a result of my Forecast Seeding data calculate.  This is causing a problem with my "isrealdata" check in my override rules.  I can do a work around on my Actual data by copying the already calced amounts and then suppress the calc rules, but then if the users have forecasted override changes they won't work.  I guess my question is can you use a Data Calculate that will result in derived zeroes for the copied Actual periods?

Case "FC_Sep"
      Select Case curMonth
         Case "M1","M2","M3","M4","M5","M6","M7","M8"
api.Data.Calculate("S#" & curScenario & ":O#Import:V#Periodic = S#" & actScenario & ":V#Periodic", "A#Balance.Base",,,,,,,"U4#Top_Srce.Base.Remove(Calc)",)
api.Data.Calculate("S#" & curScenario & ":O#Import:V#Periodic = S#" & actScenario & ":V#Periodic", "A#Nat_Net_Ctrl_Income.Base, A#S_Dozens, A#S_NCIpct",,,,,,,"U4#Top_Srce.Base.Remove(Calc)")
      End Select 'curMonth

 

1 reply

OneStream Employee
October 15, 2024

Hi, try to always remove all zeros from all calculations in order to ensure performance processes, less space being used in the database and other possible issues such as what you are describing here.

You can find the documentation here...

https://documentation.onestream.com/1375907/Content/API%20Overview/Finance%20Functions%20APIs/9.1%20-%20RemoveZeros.html

...and here.

https://documentation.onestream.com/1375907/Content/API%20Overview/Finance%20Functions%20APIs/9.3%20-%20Usage.html

Your calculation should look like this:

api.Data.Calculate("S#" & curScenario & ":O#Import:V#Periodic = removezeros(S#" & actScenario & ":V#Periodic)", "A#Balance.Base",,,,,,,"U4#Top_Srce.Base.Remove(Calc)",)

api.Data.Calculate("S#" & curScenario & ":O#Import:V#Periodic = removezeros(S#" & actScenario & ":V#Periodic)", "A#Nat_Net_Ctrl_Income.Base, A#S_Dozens, A#S_NCIpct",,,,,,,"U4#Top_Srce.Base.Remove(Calc)")

 

If you want to specifically only remove real data, you can use a data buffer and filter out the non-real data intersections by checking the isRealData boolean when looping through the data buffer. However, I generally recommend the removezeros() approach.