To calculate data in Essbase means to consolidate part or all of the database by using either the hierarchies and formulas defined in the database outline (the default calculation), or the formulas contained in a calc script.
Control Flow of the Calculation Functions
The default calculation is stored in the database and is executed by calling EsxDefaultCalc(). To get and set the script used for a default calculation, use EsxGetDefaultCalc() and either EsxSetDefaultCalc() or EsxSetDefaultCalcFile().
Like reports, calculations can be executed in one of three ways:
By passing the calc specification as a string to EsxCalc()
By passing a set of strings with EsxBeginCalc(), EsxSendString(), and EsxEndCalc()
By specifying a calc script file with EsxCalcFile()
Calculations in Essbase are asynchronous operations, meaning that when the appropriate calc function is called, the API returns to the caller immediately without waiting for the calc to finish (unlike executing a report, for example). Essbase uses asynchronous calculations because a calculation can take a significant amount of time to complete (several hours is not uncommon). So, after the calculation starts, the program must check (by calling EsxGetProcessState()) at intervals to see if the calculation is complete.
The simplest way to check is to set up a system timer to wake up a process at short intervals (say 5-10 seconds), checking the status of the calculation. While the calculation is running you can perform any other operations within your program, but you can not make function calls to the Essbase API using the same context handle.
For detailed descriptions of all these functions see EssCalc, EssBeginCalc, EssCalcFile, EsbCalc, EsbBeginCalc, and EsbCalcFile.
See API Libraries.