HEAD / TAIL

English (Español a continuación)

a) HEAD

This formula allows selecting the first “n” members of a given group, following the order of the outline.

Structure:

  • Head(Group, “n”)

Group: It can be defined in different ways:

  • DESCENDANTS, SIBLINGS, ANCESTORS…

“n”: If not specified, its default value is 1.

For example: Considering the following outline:

  • Head({DESCENDANTS([“Spain”])},5)
  • Head({SIBLINGS([“Spain”])},4)

This formula can be used within a conditional structure:

Example:

  • Case
    • When Contains([Markets].currentmember, Head({DESCENDANTS([“Spain”])},5)) THEN Sales * 1.5
    • ELSE Sales * 1.3
  • End

Calculate the value of “Obj_2022”:

  • For the first 5 descendants of «Spain»: Multiplying their sales by 1.5
  • For the rest of the members of the «Markets» dimension: Multiplying their sales by 1.3M

b) TAIL

This formula allows selecting the last “n” members of a given group, following the order of the outline.

Structure:

  • Tail(Group, “n”)

“n”: If not specified, its default value is 1.

Let’s see some examples:

  • Tail({DESCENDANTS([“Spain”])},5)
  • Tail({SIBLINGS([“Spain”])},3)

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

Español

a) HEAD

Esta fórmula permite seleccionar los “n” primeros miembros de un grupo determinado, siguiendo el orden del outline.

Estructura:

  • Head(Grupo, “n”)

Grupo: Puede venir definido de diversas maneras:

  • DESCENDANTS, SIBLINGS, ANCESTORS…

“n”: Si no se especifica, toma por defecto 1.

Por ejemplo: Partiendo del siguiente outline:

  • Head({DESCENDANTS([“España”])},5)
  • Head({SIBLINGS([“España”])},4)

Esta fórmula se puede utilizar dentro de una estructura condicional:

Ejemplo:

  • Case
    • When Contains([Mercados].currentmember, Head({DESCENDANTS([“España”])},5)) THEN Ventas * 1.5
    • ELSE Ventas * 1.3
  • End

Calcula el valor del miembro “Obj_2022”:

  • Para los 5 primeros descendientes del miembro “España”: Multiplicando sus ventas por 1,5
  • Para el resto de los miembros de la dimensión “Mercados”:  Multiplicando sus ventas por 1,3M

b) TAIL

Esta fórmula permite seleccionar los “n” últimos miembros de un grupo determinado, siguiendo el orden del outline.

Estructura:

  • Tail(Grupo, “n”)

“n”: Si no se especifica, toma por defecto 1.

Veamos algunos ejemplos:

  • Tail({DESCENDANTS([“España”])},5)
  • Tail({SIBLINGS([“España”])},3)

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

Anuncio publicitario