Summary
The Api.Data.Calculate is the easiest and simplest way to write a formula as a Member Formula or a Business Rule. The construction of an Api.Data.Calculate formula must be balanced on each side of the formula with the appropriate dimensions to prevent data explosion. There are three different ways to use the Api.Data.Calculate function: Formula with Overload, Formula with IsDurableCalculatedData, and Formula with Eval.
From a performance perspective:
-
Never use the Api.Data.Calculate in a loop when using variables.
-
Use Remove functions whenever possible especially for sparse data models with lots of NODATA cells.
-
GetDataBuffer and GetDataBufferUsingFormula may have a better performance impact. Try replacing Api.Data.Calculate when doing math with GetDataBuffer math. In some cases, performance is better by using GetDataBuffer functions in place of Api.Data.Calculate.