English (Español a continuación)
I.- Block calculation
Essbase calculates the database at the block level:
- Bring the block to memory and calc all the required values within the block.
- Essbase creates a block at each sparse dimension member intersection if at least one value exists for that block.
When executing a database total calculation (CALC ALL) Essbase calculates the blocks in order depending on the block number:
- The number of the block depends on the order of the sparse dimensions in the outline.
Instead, when a calculation script is executed, the order Essbase applies is determined by the structure of the calculation script.
Let’s see an example: the outline of a database contains the following sparse dimensions:

We have noted the order within each sparse dimension.
- Essbase descends through the first branch of the dimension to the first level 0 member (in the “Markets” dimension: Bilbao) and continues with its siblings. Next, his father (“Spain North”).
- If the father has siblings (“Spain South”), he descends through the different branches in the same way as in the previous point.
- Continue with the father of the father (“Spain”). If he has siblings («Germany») it descends in the same way as in the previous point.
- In this way it ascends through the dimension.
The numbering of the blocks:
- Cross each member of the first sparse dimension with the first member of the rest of the sparse dimensions.
- Next, cross each member from the first sparse dimension with the second member from the second sparse dimension and the first member from the rest of the dimensions.
- ….
- Next, cross each member of the first sparse dimension with the last member of the second sparse dimension and the first member of the rest of the dimensions.
- Next, cross each member from the first sparse dimension with the first member from the second sparse dimension, with the second member from the third sparse dimension, and the first member from the rest of the dimensions.
- …
In the example above:
- Block 1: Bilbao -> Camera -> Pedro
- Block 2: Barcelona -> Camera -> Pedro
- …
- Block 12: Markets -> Chamber -> Pedro
- Block 13: Bilbao -> Lenses -> Pedro
- …
- Block 24: Markets -> Lenses -> Pedro
- …
- Block 108: Markets -> Products -> Pedro
- Block 109: Bilbao -> Camera -> Juan
- …
II.- Cell calculation
Essbase applies two types of calculation:
- “Block calculation”: calculates all the cells of a block simultaneously: this system is faster but in some cases it can lead to incorrect results (if the value of a cell depends on the value of another cell that should have been calculated before).
- “Cell calculation”: calculates the cells of each block sequentially (one by one), following the order of calculation (which is determined by the order of the dense dimensions in the outline); this system is slower but sometimes it is necessary for the result to be correct.
The «Cell calculation» method may be necessary when there is dependency between cells: the value of one of the cells (cell B) depends on the value of another cell (cell A). In this case, it is necessary to calculate the value of cell A before that of cell B. Dependencies usually occur:
- With the conditional structure IF… ELSEIF
- With the @PRIOR function
By default Essbase applies the «Cell calculation» mode in formulas that contain the following functions:
- @ANCEST
- @CURRMBR
- @ISMBR (in a dense dimension)
- @MDANCESTVAL
- @MDPARENTVAL
- @MDSHIFT
- @NEXT
- @PARENT
- @PARENTVAL
- @PRIOR
- @SANCESTVAL
- @SPARENTVAL
- @SHIFT
In the rest of the formulas, Essbase applies by default the “Block calculation” mode.
When Essbase executes a calculation script, it applies by default always the most efficient calculation mode, but there are times when the choice of Essbase is not optimal: the @CALCMODE function allows to force Essbase to apply the other calculation mode.
- @CALCMODE (CELL / BLOCK)
III.- Dimensions «Accounts» and «Time»
Essbase’s method of calculating by blocks and within it all affected cells implies that when a total calculation of the base (CALC ALL) is launched, the dimensions are calculated in the following order:
- 1st: The dense dimensions (according to the order of the outline): it is the calculation carried out within each block.
- 2nd: The sparse dimensions (according to the order of the outline): it is the calculation that is carried out block by block.
The previous order can be affected if in the outline there are:
- A dimension with the property «Account».
- A dimension with the property «Time».
- And there is some formula in some member of the dimension «Account».
The order that is applied is:
- 1st: The «Account» dimension.
- 2nd: The “Time” dimension.
- 3rd: Rest of dense dimensions (according to outline order)
- 4th: Rest of sparse dimensions (according to outline order).
Essbase records in the log the order in which the dimensions were calculated.
IV.- Consolidation operators
The order of calculation must be taken into account when ordering the outline:
- If the following calculation operators are used in consolidation: multiply (*), divide (/), or percentage (%).
- On the other hand, it does not influence the calculation operators: addition (+) and subtraction (-).
When using the multiply (*), divide (/) or percentage (%) operators, the members must be carefully arranged in the outline to get the correct result.
Let’s see an example:
Suppose we want to calculate the variable «Profits»:
- Profits = (Income – Expenses) % Margin
And the data is:
- Income = 100
- Expenses = 80
- % Margin = 30%
If we order the outline in the following way it would give us an erroneous result:

Essbase would start by applying Margin (30%) to the existing figure up to that moment (0), giving a total of 0; Next, it would add 100 and subtract 80, giving Profits = 20;
The correct order would be:

Essbase would start by adding Income (100) and subtracting Expenses (80); To the previous total (20) would apply the % of Margin (30%), giving Profits = 20 * 30% = 6;
V.- Forward calculation references
For the correct result in a calculation, it is necessary to avoid that the outline contains forward calculation references:
- When the value of one member depends on the value of another member that has not yet been calculated.
This can occur when a shared member is placed ahead of its source member in the outline.

It can also occur when a member carries a formula that refers to members that have not yet been calculated:

When the outline is validated, Essbase warns:
- When a shared member precedes its source member.
- But it does NOT warn when a formula in a member contains references to members that have not yet been calculated.
Therefore, in this second case we must be especially careful to avoid that the outline contains this type of reference to future calculations.
VI.- Formulas in an outline member
The formulas applied to a member of the outline are executed:
- When performing a full database calculation (CALC ALL).
- When the member that contains the formula is calculated in the calculation script (for example, when a CALC DIM is run on the dimension of the member that has the formula).
When a formula is included in an outline member, the order of calculation of the dimensions must be analyzed:
- A one-member formula can be overwritten by the calculation of another dimension.
- For cells that have different consolidation paths, the last calculated dimension overwrites the previously calculated dimension calculations.
Let’s see an example: let’s consider a database with formulas in members of the dimensions “Years” and “Data” (sparse dimensions):

The starting data are:

When executing a CALC ALL first, the dimension ”Years” is calculated, giving the following result:

This result changes when the following dimension, «Data» is executed:

The result would also be different if the outline first has the dimension «Data» and then the dimension «Years»:
First, the dimension «Data» is calculated:

And then the dimension «Years»:

Therefore, it is important to know what is the result that we are interested in obtaining and based on this result order the dimensions appropriately.
- A calculation script can also be used to change the calculation order of dimensions.
VII.- Calculation passes
When performing a full calculation of the database Essbase tries to do it in a single pass in which it calculates all the dimensions:
- Brings each block that needs to be calculated only once into memory and performs all necessary calculations within the block and saves it.
But on certain occasions Essbase may need to perform a second pass, having to bring the block back into memory to recalculate it.
This occurs when the following circumstances occur:
- There is a dimension with the property «Account».
- There is a dimension with the property “Time”.
- At least one of the two dimensions above is dispersed.
- There is at least one member of the “Account” dimension that contains a formula.
If these 4 conditions are met, Essbase performs 2 passes:
a) Dense “Account” dimension and sparse “Time” dimension:
- In the first pass it calculates these two dimensions and in the second pass the rest of the dimensions.
b) Sparse “Account” dimension and sparse “Time” dimension:
- In the first pass it calculates these two dimensions and in the second pass the rest of the dimensions.
c) Sparse “Account” dimension and dense “Time” dimension:
- In the first pass it calculates the «Account» dimension and in the second pass the rest of the dimensions.
If any member of the outline is also assigned the “Two-Pass” property, Essbase performs a new pass to calculate these members:
- Two-pass calculation is a property that can be assigned to individual members of the outline. This property implies that the member will be calculated twice.
- This property only works on members of dimensions defined with the type «Accounts», and on members with the property «dynamic calculation» or «calculation and dynamic store».
In the log Essbase registers the order of calculation of the dimensions.
VIII.- Calculation script
In the calculation script you can set the way and the order in which you want to calculate the database.
- With the FIX… ENDFIX command you can narrow down the section of the database to which you want to apply a certain calculation.
- Also with the CALC DIM / AGG aggregation commands you can set the order in which you want to calculate the dimensions.
CALC DIM
- Calculates both dense and sparse dimensions.
- Execute the formulas of the outline members.
- The order that applies to the dimensions included in this command:
- First: the dense dimensions (according to the order they have in the outline).
- Second: the sparse dimensions (according to the order they have in the outline).
If we are interested in applying a different order, we would have to use various CALC DIM commands, adding the dimension (s) in each of them according to the order that interests us.
- FIX (Germany)
- CALC DIM (Sellers, Months, Years);
- CALC DIM (Products);
- ENDFIX
AGG
- Only works with sparse dimensions.
- It does not execute the formulas of the outline members, it only makes an aggregation based on the hierarchy (parent-child relationship) of the outline.
- The order in which it calculates the dimensions included in this command is according to the order they have in the outline.
If we are interested in applying a different order, we would have to use various AGG commands, adding the dimension (s) in each of them according to the order that interests us.
- FIX (Germany)
- AGG (Sellers);
- AGG (Products);
- ENDFIX
Any question, please send an email to: essbaseeasy@gmail.com
Español
I.- Cálculo de los bloques
Essbase calcula la base de datos a nivel de bloques:
- Lleva el bloque a la memoria y calcula todos los valores requeridos dentro del bloque.
- Essbase crea un bloque en cada intersección de miembros de las dimensiones dispersas si al menos existe un valor para ese bloque.
Cuando se lanza un cálculo total de la base (CALC ALL) Essbase calcula los bloques en orden dependiendo del número del bloque:
- El número del bloque depende del orden de las dimensiones dispersas en el outline
En cambio, cuando se lanza un script de cálculo el orden que Essbase aplica viene determinado por la estructura del script de cálculo.
Veamos un ejemplo: el outline de una base de datos contiene las siguientes dimensiones dispersas:

Hemos señalado el orden dentro de cada dimensión dispersa.
- Essbase desciende por la primera rama de la dimensión hasta el primer miembro nivel 0 (en la dimensión “Mercados”: Bilbao) y continúa con sus hermanos. A continuación, su padre (“España Norte”).
- Si este tiene hermanos (“España Sur”), desciende por las distintas ramas de igual forma que en el punto anterior.
- Sigue con el padre del padre (“España”). Si este tiene hermanos (“Alemania”) desciende de igual forma que en el punto anterior.
- De esta forma va ascendiendo por la dimensión.
La numeración de los bloques:
- Cruza cada miembro de la primera dimensión dispersa con el primer miembro del resto de dimensiones dispersas.
- A continuación, cruza cada miembro de la primera dimensión dispersa con el segundo miembro de la segunda dimensión dispersa y el primer miembro del resto de las dimensiones.
- ….
- A continuación, cruza cada miembro de la primera dimensión dispersa con el último miembro de la segunda dimensión dispersa y el primer miembro del resto de las dimensiones.
- A continuación, cruza cada miembro de la primera dimensión dispersa con el primer miembro de la segunda dimensión dispersa, con el segundo miembro de la tercera dimensión dispersa, y el primer miembro del resto de las dimensiones.
- …
En el ejemplo anterior:
- Bloque 1: Bilbao -> Cámara -> Pedro
- Bloque 2: Barcelona -> Cámara -> Pedro
- …
- Bloque 12: Mercados -> Cámara -> Pedro
- Bloque 13: Bilbao -> Lentes -> Pedro
- …
- Bloque 24: Mercados -> Lentes -> Pedro
- …
- Bloque 108: Mercados -> Productos -> Pedro
- Bloque 109: Bilbao -> Cámara -> Juan
- …
II.- Cálculo de las celdas
Essbase aplica dos tipos de cálculo:
- “Block calculation”: calcula todas las celdas de un bloque simultáneamente: este sistema es más rápido pero en algunos casos puede llevar a resultados incorrectos (si el valor de una celda depende del valor de otra celda que se debería haber calculado antes).
- “Cell calculation”: calcula las celdas de cada bloque de forma secuencial (una por una), siguiendo el orden de cálculo (que viene determinado por el orden de las dimensiones densas en el outline); este sistema es más lento pero a veces es necesario para que el resultado sea correcto.
El método “Cell calculation” puede ser necesario cuando hay dependencia entre las celdas: el valor de una de las celdas (celda B) depende del valor de otra celda (celda A). En este caso es necesario calcular el valor de la celda A antes que el de la celda B. Las dependencias se suelen producir:
- Con la estructura condicional IF…ELSEIF
- Con la función @PRIOR
Por defecto Essbase aplica el modo “Cell calculation” en fórmulas que contienen las siguientes funciones:
- @ANCEST
- @CURRMBR
- @ISMBR (en una dimensión densa)
- @MDANCESTVAL
- @MDPARENTVAL
- @MDSHIFT
- @NEXT
- @PARENT
- @PARENTVAL
- @PRIOR
- @SANCESTVAL
- @SPARENTVAL
- @SHIFT
En el resto de fórmulas Essbase aplica por defecto el modo “Block calculation”.
Cuando Essbase ejecuta un script de cálculo aplica por defecto el modo de cálculo más eficiente en cada momento, pero hay veces que la elección de Essbase no es la óptima: la función @CALCMODE permite forzar a Essbase a aplicar el otro modo de cálculo.
- @CALCMODE(CELL / BLOCK)
III.- Dimensiones “Cuentas” y “Tiempo”
El método que aplica Essbase de calcular por bloques y dentro de él todas las celdas afectadas implica que cuando se lanza un cálculo total de la base (CALC ALL) las dimensiones se calculan según el siguiente orden:
- 1º: Las dimensiones densas (según orden del outline): es el cálculo que realiza dentro de cada bloque.
- 2º: Las dimensiones dispersas (según orden del outline): es el cálculo que va realizando bloque a bloque.
El orden anterior se puede ver afectado si en el outline existen:
- Una dimensión con la propiedad “Cuenta”.
- Una dimensión con la propiedad “Tiempo”.
- Y hay alguna fórmula en algún miembro de la dimensión “Cuenta”.
El orden que se aplica es:
- 1º: La dimensión “Cuenta”.
- 2º: La dimensión “Tiempo”.
- 3º: Resto de dimensiones densas (según orden del outline).
- 4º: Resto de dimensiones dispersas (según orden del outline).
Essbase recoge en el log el orden en el que ha calculado las dimensiones.
IV.- Operadores de consolidación
El orden de cálculo hay que tenerlo en cuenta a la hora de ordenar el outline:
- Si se utilizan los siguientes operadores de cálculo en la consolidación: multiplicar (*), dividir (/) o porcentaje (%).
- En cambio no influye con los operadores de cálculo: suma (+) y resta (-).
Cuando se utilizan los operadores de multiplicar (*), dividir (/) o porcentaje (%) hay que ordenar cuidadosamente los miembros en el outline para conseguir el resultado correcto.
Veamos un ejemplo:
Supongamos que queremos calcular la variable ”Beneficios”:
- Beneficios = (Ingresos – Gastos) % Margen
Y los datos son:
- Ingresos = 100
- Gastos = 80
- % Margen = 30%
Si ordenamos el outline de la siguiente manera nos daría un resultado erróneo:

Essbase comenzaría aplicando Margen (30%) a la cifra existente hasta ese momento (0), dando un total de 0; a continuación, sumaría 100 y restaría 80, dando Beneficios = 20;
El orden correcto sería:

Essbase comenzaría sumando Ingresos (100) y restando Gastos (80); al total anterior (20) le aplicaría el % de Margen (30%), dando Beneficios = 20 * 30% = 6;
V.- Forward calculation references
Para que el resultado del cálculo sea correcto hay que evitar que el outline contenga referencia a cálculo futuros (forward calculation references):
- Cuando el valor de un miembro depende del valor de otro miembro que aún no se ha calculado.
Esto puede ocurrir cuando en el outline se sitúa un miembro compartido por delante de su miembro origen.

También puede ocurrir cuando un miembro lleva una fórmula que hace referencia a miembros que aún no se han calculado:

Cuando se valida el outline Essbase avisa:
- Cuando un miembro compartido precede a su miembro origen.
- Pero NO avisa cuando una fórmula en un miembro contiene referencias a miembros que aún no se han calculado.
Por eso, en este segundo caso hay que ser especialmente cuidadosos de evitar que el outline contenga este tipo de referencia a cálculos futuros.
VI.- Fórmulas en un miembro del outline
Las fórmulas aplicadas a un miembro del outline se ejecutan:
- Cuando se realiza un cálculo completo de la base de datos (CALC ALL).
- Cuando en el script de cálculo se calcula el miembro que contiene la fórmula (por ejemplo, cuando se ejecuta un CALC DIM de la dimensión del miembro que tiene la fórmula).
Cuando se incluye una fórmula en un miembro del outline hay que analizar el orden de cálculo de las dimensiones:
- Una fórmula de un miembro puede ser sobrescrita por el cálculo de otra dimensión.
- Aquellas celdas que tienen distintas rutas de consolidación, la dimensión calculada en último lugar sobrescribe los cálculos de dimensiones calculadas previamente.
Veamos un ejemplo: consideramos una base de datos con fórmulas en miembros de las dimensiones “Años” y “Variables” (dimensiones dispersas):

Los datos de partida son:

Al ejecutar un CALC ALL primero se calcula la dimensión” Años”, dando el siguiente resultado:

Este resultado cambia cuando se ejecuta la siguiente dimensión, “Variables”:

El resultado además sería distinto si en el outline primero estuviera la dimensión “Variables” y luego la dimensión “Años”:
Primero se calcularía la dimensión “Variables”:

Y luego la dimensión “Años”:

Por ello, es importante saber cuál es el resultado que nos interesa obtener y en base a ello ordenar las dimensiones de forma adecuada.
- También se puede utilizar un script de cálculo para cambiar el orden de cálculo de las dimensiones.
VII.- Calculation passes
Cuando se realiza un cálculo completo de la base Essbase intenta realizarlo en una única pasada en la que calcula todas las dimensiones:
- Lleva cada bloque que necesita ser calculado una única vez a la memoria y realiza todos los cálculos necesarios dentro del bloque y lo guarda.
Pero en ciertas ocasiones puede necesitar realizar una segunda pasada, teniendo que traer nuevamente el bloque a la memoria para volverlo a calcular.
Esto ocurre cuando se dan las siguientes circunstancias:
- Hay una dimensión con la propiedad “Cuenta”.
- Hay una dimensión con la propiedad “Tiempo”.
- Al menos una de las dos dimensiones anteriores es dispersa.
- Al menos hay un miembro de la dimensión “Cuenta” que contiene una fórmula.
Si concurren estas 4 condiciones Essbase realiza 2 pasadas:
a) Dimensión “Cuenta” densa y dimensión “Tiempo” dispersa:
- En la primera pasada calcula estas dos dimensiones y en la segunda pasada el resto de dimensiones.
b) Dimensión “Cuenta” dispersa y dimensión “Tiempo” dispersa:
- En la primera pasada calcula estas dos dimensiones y en la segunda pasada el resto de dimensiones.
c) Dimensión “Cuenta” dispersa y dimensión “Tiempo” densa:
- En la primera pasada calcula la dimensión “Cuenta” y en la segunda pasada el resto de dimensiones.
Si además algún miembro del outline tiene asignada la propiedad “Two-Pass”, Essbase realiza una nueva pasada para calcular estos miembros:
- El cálculo en dos pasadas es una propiedad que se puede asignar a miembros individuales del outline. Esta propiedad implica que el miembro se va a calcular dos veces.
- Esta propiedad tan sólo funciona en miembros de dimensiones definidas con el tipo “Cuentas”, y en miembros con tipo de almacenamiento “cálculo dinámico” o “cálculo y almacenamiento dinámico”.
Essbase registra en el log el orden de cálculo de las dimensiones.
VIII.- Script de cálculo
En el script de cálculo se puede fijar el modo y el orden en el que se quiere calcular la base de datos.
- Con el comando FIX … ENDFIX se puede ir acotando la sección de la base de datos a la que se le quiere aplicar un determinado cálculo.
- También con los comandos de agregación CALC DIM / AGG se puede fijar el orden en el que se quiere calcular las dimensiones.
CALC DIM
- Calcula tanto dimensiones densas como dispersas.
- Ejecuta las fórmulas de los miembros del outline.
- El orden que aplica a las dimensiones incluidas en este comando:
- Primero: las dimensiones densas (según el orden que tienen en el outline).
- Segundo: las dimensiones dispersas (según el orden que tienen en el outline).
Si nos interesa aplicar un orden diferente habría que utilizar diversos comandos CALC DIM, agregando en cada uno de ellos la(s) dimensión(es) según el orden que nos interese.
- FIX(Alemania)
- CALC DIM(Vendedores,Meses,Años);
- CALC DIM(Productos);
- ENDFIX
AGG
- Sólo funciona con dimensiones dispersas.
- No ejecuta las fórmulas de los miembros del outline, sólo hace una agregación en base a la jerarquía (relación padre-hijo) del outline.
- El orden en el que calcula las dimensiones incluidas en este comando es según el orden que estas tienen en el outline.
Si nos interesa aplicar un orden diferente habría que utilizar diversos comandos AGG, agregando en cada uno de ellos la(s) dimensión(es) según el orden que nos interese.
- FIX(Alemania)
- AGG(Vendedores);
- AGG(Productos);
- ENDFIX
Cualquier consulta envía, por favor, un correo a: essbaseeasy@gmail.com