English (Español a continuación)
I.- CALCULATE COLUMN
This command allows to create a new calculated column when executing the Report Script.
Its syntax is:
- {CALCULATE COLUMN “New Column” = “Expression”}
“New Column”: is the name of the new column; must be between “ “.
«Expression»:
- It can be used:
- Reference to existing columns according to their original position: the first column being 0, the next 1… The expression must make references to columns with data.
- Numbers: they can be with decimals (for example: 0.07) or integers (which must be followed by a “.” to differentiate them from references to columns: for example: 7.)
- The mathematical operators that can be used:
- +
- –
- *
- /
- %x%y (calculates x as a % of y).
- x:y (adds the data between x and y, inclusive; if this operator is used in complex expressions with more operators, it must go first).
- If no default operator is specified, “+” is applied.
- Expressions are read from left to right and parentheses can NOT be used.
Let’s look at an example:
- {CALCULATE COLUMN “Weighted Sales” = 1 + 5 + 2 * 3.} A new column is calculated, called “Weighted Sales”, as the sum of columns 1+5+2, and this sum is multiplied by 3; If we want only multiply the 2nd column by 3, we must change the order: 2 * 3 + 1 + 5
- {CALCULATE COLUMN “Year Sales” = 5:16} A new column is calculated, called “Year Sales”, as the sum of columns 5 to 16.
- {CALCULATE COLUMN “Increased Sales” = 3+15.} A new column is calculated, called “Increased Sales”, adding 15 to the 3rd column.
Some considerations:
- For this command to work, the column definition must go in the Report Script before the row definition.
- The calculated column is placed (by default) to the right of the existing ones, assigning it the corresponding number, although its position in the Report can be changed with the command {ORDER}.
- A maximum of 50 calculated columns can be included.
- The possibilities of this command are limited; to do complex calculations it is preferable to do them in the calculation script.
Let’s see some examples: starting from a Report Script with the following definition of the “<COLUMN” section:
- <COLUMN(“Months”)
- «January»
- «February»
- «March»
We get the following output:

a) We include the following instruction:
- <COLUMN(“Months”)
- «January»
- «February»
- «March»
- {CALCULATE COLUMN “1T” = 3 + 4 + 5}
We get the following output:

Columns are numbered from left to right, starting with column 0 (“Spain”) and so on (for example, column “January” is the 3rd). The calculated column is the 6th, the result of adding «January» (3rd column), «February» (4th column) and «March» (5th column).
The expression {CALCULATE COLUMN “1T” = 3 + 4 + 5} is equivalent to {CALCULATE COLUMN “1T” = 3 : 5}
b) In the following example we add the 3 columns multiplying them by 2:
- <COLUMN(“Months”)
- «January»
- «February»
- «March»
- {CALCULATE COLUMN “1T” = 3 + 4 + 5 * 2}
We get the following output:

ATTENTION: if we apply {CALCULATE COLUMN “1T” = 3*2 + 4*2 + 5*2} we would obtain a different result than the intended one: it would multiply the data for “January” by 2 and the result would be added to “February”; this sum would be multiplied by 2 and the result would be added to «March»; this sum would be multiplied by 2.
- We mentioned before that parentheses cannot be used to isolate the products and add their results.
- Also, we indicated earlier that the possibilities for calculating columns in the Report Script are limited.
c) In the following example we calculate 2 columns and use the {ORDER} command to place them in a certain order:
- <COLUMN(“Months”)
- {ORDER 0 1 2 3 4 6 5 7}
- «January»
- «February»
- «March»
- {CALCULATE COLUMN “JAN_FEB” = 3 + 4}
- {CALCULATE COLUMN “FEB_MAR” = 4 + 5}
The output we get is:

In the original order, to the existing columns correspond positions 0 to 5; to the first column calculated corresponds the 6th position, and to the second the 7th position. With the command {ORDER} we modify the output order.
II.- OTHER COMMANDS
{OFFCOLCALCS}: Disables all calculated columns that have been previously included in the Report Script.
- This command must be placed after {CALCULATE COLUMN}.
- The headers of the calculated columns are kept but with #missing values.
III.- INCLUDE COLUMN WITH TEXT
We can use the command {MASK} to insert a column of text into the Report Script.
Syntax:
- {MASK Position “Text”}
Position: this number indicates the position for the new column.
“Text”: Text to be included; has to go between “ “.
Let’s look at an example:
- <COLUMN(“Months”)
- {MASK 50 “USD”}
- «January»
- «February»
- «March»

Any question, please send an email to: essbaseeasy@gmail.com
Español
I.- CALCULATE COLUMN
Este comando permite crear una nueva columna calculada al ejecutar el Report Script.
Su sintaxis es:
- {CALCULATE COLUMN “Nueva Columna” = “Expresión”}
“Nueva Columna”: es el nombre de la nueva columna; debe ir entre “ “.
“Expresión”:
- Se pueden utilizar:
- Referencia a las columnas ya existentes según su posición original: siendo la primera columna la 0, la siguiente la 1… La expresión tiene que hacer referencias a columnas con datos.
- Números: pueden ser con decimales (por ejemplo: 0.07) o números enteros (a los que hay que poner detrás un “.” para diferenciarlos de referencias a columnas: por ejemplo: 7.)
- Los operadores matemáticos que se pueden utilizar:
- +
- –
- *
- /
- %x%y (calcula x como % de y).
- x:y (suma los datos entre x e y, incluidos; si se utiliza este operador en expresiones complejas con más operadores debe ir en primer lugar).
- Si no se especifica ningún operador por defecto se aplica “+”.
- Las expresiones se leen de izquierda a derecha y NO se pueden utilizar paréntesis.
Veamos un ejemplo:
- {CALCULATE COLUMN “Ventas Ponderadas” = 1 + 5 + 2 * 3.} Se calcula una nueva columna, que denominamos “Ventas Ponderadas”, como suma de las columnas 1+5+2, y esta suma la multiplica por 3; si queremos que el 3 sólo multiplique a la columna 2ª debemos cambiar el orden: 2 * 3 + 1 + 5
- {CALCULATE COLUMN “Ventas Año” = 5:16} Se calcula una nueva columna, que denominamos “Ventas Año”, como suma de las columnas 5 a la 16.
- {CALCULATE COLUMN “Ventas Incrementadas” = 3+15.} Se calcula una nueva columna, que denominamos “Ventas Incrementadas”, sumando 15 a la 3ª columna.
Algunas consideraciones:
- Para que funcione este comando la definición de columnas debe ir en el Report Script por delante de la definición de filas.
- La columna calculada se sitúa (por defecto) a la derecha de las ya existentes, asignándole el número correspondiente, si bien con el comando {ORDER} se puede cambiar su posición en el Report.
- Se puede incluir un máximo de 50 columnas calculadas.
- Las posibilidades de este comando son limitadas; para hacer cálculos complejos es preferible realizarlos en el script de cálculo.
Veamos algunos ejemplos: partiendo de un Report Script con la siguiente definición de la sección “<COLUMN”:
- <COLUMN(“Meses”)
- “Enero”
- “Febrero”
- “Marzo”
Obtenemos la siguiente salida:

a) Incluimos la siguiente instrucción:
- <COLUMN(“Meses”)
- “Enero”
- “Febrero”
- “Marzo”
- {CALCULATE COLUMN “1T” = 3 + 4 + 5}
Obtenemos la siguiente salida:

Las columnas se numeran de izquierda a derecha, empezando por la columna 0 (“España”) y así sucesivamente (por ejemplo, la columna “Enero” es la 3ª). La columna calculada es la 6ª, resultado de sumar “Enero” (columna 3ª), “Febrero” (columna 4ª) y “Marzo” (columna 5ª).
La expresión {CALCULATE COLUMN “1T” = 3 + 4 + 5} es equivalente a {CALCULATE COLUMN “1T” = 3 : 5}
b) En el siguiente ejemplo sumamos las 3 columnas multiplicándolas por 2:
- <COLUMN(“Meses”)
- “Enero”
- “Febrero”
- “Marzo”
- {CALCULATE COLUMN “1T” = 3 + 4 + 5 * 2}
Obtenemos la siguiente salida:

ATENCIÓN: si aplicáramos {CALCULATE COLUMN “1T” = 3*2 + 4*2 + 5*2} obtendríamos un resultado diferente al pretendido: multiplicaría los datos de “Enero” por 2 y el resultado se lo sumaría a “Febrero”; esta suma la multiplicaría por 2 y el resultado se lo sumaría a “Marzo”; esta suma la multiplicaría por 2.
- Además, no se pueden utilizar paréntesis para aislar los productos y sumar sus resultados.
- Indicamos anteriormente que las posibilidades del cálculo de columnas en el Report Script son limitadas.
c) En el siguiente ejemplo calculamos 2 columnas y utilizamos el comando {ORDER} Para situarlas en un orden determinado:
- <COLUMN(“Meses”)
- {ORDER 0 1 2 3 4 6 5 7}
- “Enero”
- “Febrero”
- “Marzo”
- {CALCULATE COLUMN “ENE_FEB” = 3 + 4}
- {CALCULATE COLUMN “FEB_MAR” = 4 + 5}
La salida que obtenemos es:

En el orden original a las columnas existentes les corresponden las posiciones de la 0 a la 5; a la primera columna calculada la posición 6ª, y a la segunda la posición 7ª. Con el comando {ORDER} modificamos el orden de salida.
II.- OTROS COMANDOS
{OFFCOLCALCS}: Deshabilita todas las columnas calculadas que se hayan incluido anteriormente en el Report Script.
- Este comando hay que situarlo después de {CALCULATE COLUMN}.
- Se mantienen las cabeceras de la columnas calculadas pero con valores #missing.
III.- INCLUIR COLUMNA CON TEXTO
Podemos utilizar el comando {MASK} para introducir una columna de texto en el Report Script.
Sintaxis:
- {MASK Posición “Texto”}
Posición: número con el que indicamos la posición que va a ocupar la nueva columna.
“Texto”: Texto que queremos incluir; tiene que ir entre “ “.
Veamos un ejemplo:
- <COLUMN(“Meses”)
- {MASK 50 “USD”}
- “Enero”
- “Febrero”
- “Marzo”

Cualquier consulta envía, por favor, un correo a: essbaseeasy@gmail.com