Forum Discussion

johnal67's avatar
johnal67
Contributor
3 months ago

Forecast seeding copying derived zeros to a hard zero from calculate

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

 

  • Henning's avatar
    Henning
    Valued Contributor II

    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...

    RemoveZeros (onestream.com)

    ...and here.

    Remove Functions Usage (onestream.com)

    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.