Writing Stored Calculations
When writing a Member Formula or a Business Rule for a Stored Calculation, the new calculated numbers store data for that Cube, Entity, Parent, Cons, Scenario, and Time combination. For example, a Data Unit.
Return is never seen in a Member Formula for Formula Pass. Instead of being returned, many numbers are calculated and stored. When running a Calculation, Translation, or Consolidation, it calls the Member Formula once for an entire Data Unit. OneStream does not tell with which Account, Flow, or User Defined the numbers are being saved.
Initially, this may be confusing because Member Formulas are often written in an account’s Formula property, and administrators believe OneStream will only allow that specific Member Formula to write to that specific account. However, putting a Member Formula in an account’s Formula property is only for organizational purposes. When OneStream calls that formula, it is currently calculating a Data Unit and will initialize the API engine with only the Data Unit Dimensions.
Basic stored formulas are commonly used via the Api.Data.Calculate api function. Api.Data.Calculate is used in three different ways:
-
Api.Data.Calculate using Formula as String, Overload Functions, Eval Function, and IsDurableCalculatedData
-
Api.Data.Calculate using Formula as String and IsDurableCalculatedData
-
Api.Data.Calculate using Formula as String and Eval Function