UNION

English (Español a continuación)

This function joins the members of two groups.

Its structure:

  • UNION(Group 1, Group 2 [, ALL])

Each group can include members of one or more dimensions, but the 2 groups must have the same structure: Include the same dimensions and in the same order (an example with 2 dimensions is shown at the end of the lesson).

The «ALL» parameter is optional; if it is included the result incorporates the duplicate members.

  • By default (if this parameter is not included) duplicate members are excluded.

This function can be used with a conditional structure: For example, consider the dimension «Markets»:

  • IIF(Count(Intersect(UNION({Group 1},{Group 2}),{[Markets].currentmember})) = 1, x, y)

Another example:

  • Case
    • When Contains([Markets].currentmember, UNION({Group 1},{Group 2})) then x
    • Else y
  • End

In both cases, when the member of the dimension «Markets» ([Markets].currentmember) belongs to «Group 1» or «Group 2» (UNION({Group 1},{Group 2})) it assigns the value «x»; otherwise it assigns the value “y”.

This conditional structure can be used as a formula in an outline member (of a dynamic dimension).

For example: We calculate the sales target for the year 2022 including the following formula in the member “Obj_2022” (of the dynamic dimension “Years”):

  • Case
    • When Contains([Markets].currentmember, UNION({DESCENDANTS([Europe])},{DESCENDANTS([America])})) then 150
    • Else 100
  • End

This expression assigns the sales target for the year 2022:

  • When the member of the dimension «Markets» is a descendant of «Europe» or «America» assigns a target of 150
  • To the rest of markets it assigns a target of 100

Let’s see an example with 2 dimensions:

  • IIF(Count(Intersect(UNION({CrossJoin({DESCENDANTS([Europe])},{[Sales]})}, {CrossJoin({DESCENDANTS([America])},{[Sales]})}), {Crossjoin({[Data].currentmember},{[Markets].currentmember})})) = 1, x, y)

This function assigns a value “x” to those calculated blocks in which the dimensions “Data” and “Markets” (Crossjoin({[Data].currentmember},{[Markets].currentmember})) include the member “Sales” and the member of the dimension “Markets” is a descendant of “Europe” or “America” (UNION({CrossJoin({DESCENDANTS([Europe])},{[Sales]})}, {CrossJoin({DESCENDANTS([America])},{[Sales]})})).

To the rest of combinations of members of the «Markets» dimension and members of the «Data» dimension it assigns a value «y».

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

Español

Esta función une los miembros de dos grupos.

Su estructura:

  • UNION(Grupo 1, Grupo 2 [, ALL])

En cada grupo se pueden incluir miembros de una o más dimensiones, pero los 2 grupos que se unen tienen que tener la misma estructura: Incluir las mismas dimensiones y en el mismo orden (al final de la lección se muestra un ejemplo con 2 dimensiones).

El parámetro “ALL” es opcional; si se incluye el resultado incorpora los miembros duplicados.

  • Por defecto (si no se incluye este parámetro) los miembros duplicados se excluyen.

Esta función se puede utilizar dentro de una estructura condicional: Por ejemplo, consideremos la dimensión “Mercados”:

  • IIF(Count(Intersect(UNION({Grupo 1},{Grupo 2}),{[Mercados].currentmember})) = 1, x, y)

Otro ejemplo:

  • Case
    • When Contains([Mercados].currentmember, UNION({Grupo 1},{Grupo 2})) then x
    • Else y
  • End

En ambos casos, cuando el miembro de la dimensión “Mercados” ([Mercados].currentmember) pertenece al ”Grupo 1” o al “Grupo 2” (UNION({Grupo 1},{Grupo 2})) le asigna el valor “x”; en caso contrario le asigna el valor “y”.

Esta estructura condicional se puede utilizar como fórmula en un miembro del outline (de una dimensión dinámica).

Por ejemplo: Calculamos el objetivo de ventas del año 2022 incluyendo la siguiente fórmula en el miembro “Obj_2022” (de la dimensión dinámica “Años”):

  • Case
    • When Contains([Mercados].currentmember, UNION({DESCENDANTS([Europa])},{DESCENDANTS([América])})) then 150
    • Else 100
  • End

Esta expresión asigna el objetivo de ventas del año 2022:

  • Cuando el miembro de la dimensión “Mercados” es descendiente de “Europa” o “América” le asigna un objetivo de 150
  • Al resto de mercados le asigna un objetivo de 100

Veamos un ejemplo con 2 dimensiones:

  • IIF(Count(Intersect(UNION({CrossJoin({DESCENDANTS([Europa])},{[Ventas]})}, {CrossJoin({DESCENDANTS([América])},{[Ventas]})}), {Crossjoin({[Datos].currentmember},{[Mercados].currentmember})})) = 1, x, y)

Esta función asigna un valor “x” a aquellos bloques calculados en los que las dimensiones “Datos” y “Mercados” (Crossjoin({[Datos].currentmember},{[Mercados].currentmember})) incluyen el miembro “Ventas” y el miembro de la dimensión “Mercados” es descendiente de “Europa” o de “América” (UNION({CrossJoin({DESCENDANTS([Europa])},{[Ventas]})}, {CrossJoin({DESCENDANTS([América])},{[Ventas]})})).

Al resto de combinaciones de miembros de la dimensión “Mercados” y miembros de la dimensión “Datos” le asigna un valor “y”.

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

Anuncio publicitario