FILTER

English (Español a continuación)

This function selects those members of a group that meet a certain condition.

Its structure:

  • FILTER(Group, Condition)

Group: Is the group of members that this function analyzes to select those that meet the established condition.

Condition: Can be numeric (for example, value > 50) or text (for example, member name starts with “AT”).

Let’s see an example:

  • FILTER({DESCENDANTS([Europe])}, [Sales] > 100)

Select those markets descendants of the member «Europe» whose sales are greater than 100.

Another example:

  • FILTER({DESCENDANTS([Europe])}, LEFT([Markets].CurrentMember.Member_Name, 1) = “A”)

Select those markets descendants of «Europe» whose names begin with «A».

This function can be used in conjunction with other functions:

  • FILTER({UNION({DESCENDANTS([Europe])}, {DESCENDANTS([America])})}, [Sales] > 100)

Or also within a conditional structure: For example, consider the dimension «Markets»:

  • IIF(Contains([Markets].CurrentMember,FILTER({CHILDREN([Europe])}, [Sales] > 100)), 125, 75)

Another example:

  • Case
    • When Contains([Markets].CurrentMember,FILTER({CHILDREN([Europe])}, [Sales] > 100)) Then 125
    • Else 75
  • End

Both structures assign a value of 125 to those markets that are «children» of Europe with sales greater than 100; to the rest of markets, a value of 75.

More than one dimension can be referenced in the condition:

  • Case
    • When Contains([Markets].CurrentMember,FILTER({CHILDREN([Europe])}, ([“Year 2021”],[Months].CurrentMember).Value > 100)) Then 125
    • Else 75
  • End

This structure assigns:

  • To those markets that are «children» of Europe:
    • When sales in a given month of 2021 are greater than 100: A value of 125 is assigned to that month.
    • For the rest of the cases: A value of 75.
  • To the rest of the markets: A value of 75.

Another example:

  • Case
    • When Contains([Markets].CurrentMember,FILTER({CHILDREN([Europe])}, ([“Year 2021”],[Months].CurrentMember,[Data].CurrentMember).Value > 100)) Then 125
    • Else 75
  • End

This structure assigns:

  • When the member of the dimension «Market» is «child» of «Europe»:
    • When the member of the «Data» dimension (Sales, Profits, Margin…) in a given month of the year 2021 has a value greater than 100: Assigns a value of 125 to that data in that month.
    • To the rest: Assigns a value of 75
  • To the rest of the markets: Assigns a value of 75

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 by including the following formula in the member “Obj_2022” (from the dynamic dimension “Years”):

  • Case
    • When Contains([Markets].CurrentMember, FILTER({DESCENDANTS([Europe])}, ([“Year 2021”],[Sales]).Value > 100)) Then
      • Case
        • When Contains([Markets].CurrentMember, FILTER({DESCENDANTS([Europe])}, LEFT([Markets].CurrentMember.Member_Name, 1) = “A”)) Then 125
        • Else 75
      • End
    • Else 50
  • End

This structure assigns the sales target for the year 2022:

  • To those markets that are descendants of Europe with sales in 2021 greater than 100:
    • If the market name begins with “A”: A target of 125
    • To the rest of the descendants of Europe: A target of 75
  • To the rest of the markets: A target of 50

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

Español

Esta función selecciona aquellos miembros de un grupo que cumplen una condición determinada.

Su estructura:

  • FILTER(Grupo, Condición)

Grupo: es el grupo de miembros que esta función analiza para seleccionar aquellos que cumplan la condición establecida.

Condición: Puede ser de tipo numérico (por ejemplo, valor > 50) o de texto (por ejemplo, nombre del miembro comienza por “AT”).

Veamos un ejemplo:

  • FILTER({DESCENDANTS([Europa])}, [Ventas] > 100)

Selecciona aquellos mercados descendientes del miembro “Europa” cuyas ventas son mayores de 100.

Otro ejemplo:

  • FILTER({DESCENDANTS([Europa])}, LEFT([Mercados].CurrentMember.Member_Name, 1) = “A”)

Selecciona aquellos mercados descendientes del miembro “Europa” cuyos nombres comienzan por “A”.

Esta función se puede utilizar en conjunción con otras funciones:

  • FILTER({UNION({DESCENDANTS([Europa])}, {DESCENDANTS([América])})}, [Ventas] > 100)

O también dentro de una estructura condicional: Por ejemplo, consideremos la dimensión “Mercados”:

  • IIF(Contains([Mercados].CurrentMember,FILTER({CHILDREN([Europa])}, [Ventas]  > 100)), 125, 75)

Otro ejemplo:

  • Case
    • When Contains([Mercados].CurrentMember,FILTER({CHILDREN([Europa])}, [Ventas]  > 100)) Then 125
    • Else 75
  • End

Ambas estructuras asignan a aquellos mercados que son “hijos” del miembro Europa con ventas mayores de 100 un valor de 125; al resto de mercados, un valor de 75.

En la condición se puede hacer referencia a más de una dimensión:

  • Case
    • When Contains([Mercados].CurrentMember,FILTER({CHILDREN([Europa])}, ([“Año 2021”],[Meses].CurrentMember).Value  > 100)) Then 125
    • Else 75
  • End

Esta estructura asigna:

  • A aquellos mercados que son “hijos” de Europa:
    • Cuando las ventas en un mes determinado del 2021 sean mayores de 100: A ese mes le asigna un valor de 125
    • Al resto de casos, un valor de 75.
  • Al resto de mercados, un valor de 75.

Otro ejemplo:

  • Case
    • When Contains([Mercados].CurrentMember,FILTER({CHILDREN([Europa])}, ([“Año 2021”],[Meses].CurrentMember,[Datos].CurrentMember).Value  > 100)) Then 125
    • Else 75
  • End

Esta estructura asigna:

  • Cuando el miembro de la dimensión “Mercado” es “hijo” del miembro “Europa”:
    • Cuando el miembro de la dimensión “Datos” (Ventas, Beneficios, Margen…) en un mes determinado del año 2021 tenga un valor mayor de 100: S ese dato en ese mes le asigna un valor de 125
    • Al resto: Le asigna un valor de 75
  • Al resto de mercados: Le asigna un valor de 75

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, FILTER({DESCENDANTS([Europa])}, ([“Año 2021”],[Ventas]).Value  > 100)) Then
      • Case
        • When Contains([Mercados].CurrentMember, FILTER({DESCENDANTS([Europa])}, LEFT([Mercados].CurrentMember.Member_Name, 1) = “A”)) Then 125
        • Else 75
      • End
    • Else 50
  • End

Esta estructura asigna el objetivo de ventas del año 2022:

  • A aquellos mercados que son descendientes de Europa con ventas en el año 2021 superiores a 100:
    • Si el nombre del mercado comienza por “A”: un objetivo de 125
    • Al resto de descendientes de Europa: un objetivo de 75
  • Al resto de mercados: un objetivo de 50

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

Anuncio publicitario