ABS – INT – ROUND – TRUNCATE – REMAINDER

English (Español a continuación)

The following functions can be included as formulas in the outline.

a) ABS

This formula gets the absolute value of a given value:

  • Abs(Value)

For example:

b) INT

This formula gets the integer immediately before a given value:

  • Int(Value)

For example:

c) ROUND

This formula rounds a given value to a specified number of digits:

  • Round(Value, “n”)

Being «n» the number of digits to which it is rounded:

  • If positive, indicate the number of decimal places: 1 rounds to the tenth; 2 round to the hundredth…
  • If zero, round to the unit.
  • If negative: -1 round to tens; -2 round to the hundreds…

For example:

This formula rounds 5 up. For example:

  • Round(1.55, 1) = 1.6
  • Round(1.5, 0) = 2
  • Round(15, -1) = 20

d) TRUNCATE

This formula holds the integer part of a given value:

  • Truncate(Value)

For example:

Unlike the rounding formula, this formula truncates to units without including decimal places.

  • If we are interested in truncating a number up to a certain decimal figure, we must modify the formula by multiplying and dividing by 1 followed by as many zeros as decimal figures we are interested in maintaining.

For example, if we are interested in truncating to the third decimal place:

  • Truncate(Value * 1000) / 1000

  For example:

  • Truncate(42.3456 * 1000) / 1000 = 42.345

e) REMAINDER

This formula gets the decimal part of a number:

  • Remainder(Value)

For example:

All of the above formulas can be included as formulas in an outline member.

For example, we include the following formula in the member “Obj_2022” (from the dynamic dimension “Years”).

  • When IS ([INDICATOR].CurrentMember, [“Sales”])
    • ROUND([“2021”,2])
  • End

Calculates the “Sales” target (member of the “Metrics” dimension) for the year 2022 as the sales of year 2021 rounded to the second decimal place.

Any question, please send an email to: essbaseeasy@gmail.com

Español

Las siguientes funciones se pueden incluir como fórmulas en el outline.

a) ABS

Esta fórmula obtiene el valor absoluto de un valor determinado:

  • Abs(Valor)

Por ejemplo:

b) INT

Esta fórmula obtiene el número entero inmediatamente anterior a un valor determinado:

  • Int(Valor)

Por ejemplo:

c) ROUND

Esta fórmula redondea un valor determinado a la cifra especificada:

  • Round(Valor, “n”)

Siendo “n” la cifra a la que se redondea:

  • Si es positiva indica el número de decimales: 1 redondea a la décima; 2 redondea a la centésima…
  • Si es cero redondea a la unidad.
  • Si es negativa: -1 redondea a la decena; -2 redondea a la centena…

Por ejemplo:

Esta fórmula redondea el 5 hacia la unidad superior. Por ejemplo:

  • Round(1.55, 1) = 1.6
  • Round(1.5, 0) = 2
  • Round(15, -1) = 20

d) TRUNCATE

Esta fórmula mantiene la parte entera de un valor determinado:

  • Truncate(Valor)

Por ejemplo:

A diferencia de la fórmula de redondeo, esta fórmula trunca a la unidad sin incluir decimales.

  • Si nos interesa truncar un número hasta cierta cifra decimal hay que modificar la fórmula multiplicando y dividiendo por 1 seguido de tantos ceros como cifras decimales nos interese mantener.

Por ejemplo, si nos interesa truncar hasta la tercera cifra decimal:

  • Truncate(Valor * 1000) / 1000

 Por ejemplo:

  • Truncate(42.3456 * 1000) / 1000 = 42.345

e) REMAINDER

Esta fórmula obtiene la parte decimal de un número:

  • Remainder(Valor)

Por ejemplo:

Todas las fórmulas anteriores se pueden incluir como fórmulas en un miembro del outline.

Por ejemplo, incluimos la siguiente fórmula en el miembro “Obj_2022” (de la dimensión dinámica “Años”).

  • When IS ([INDICADOR].CurrentMember, [“Ventas”])
    • ROUND([“2021”,2])
  • End

Calcula el objetivo de “Ventas” (miembro de la dimensión “Métricas”) del año 2022 como las ventas del año 2021 redondeadas al segundo decimal.

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

Anuncio publicitario