ISEMPTY

English (Español a continuación)

It is a boolean function that returns “True” if the cell is empty (#missing) and “False” if it is not.

Its structure:

  • isEmpty (Expression)

For example:

  • IsEmpty([2022])

If the member «2022» has no value, it returns «True», if it has a value (including 0) it returns «False».

If we want to include the value 0 we have to join 2 conditions:

  • IsEmpty([2022]) OR [2022] = 0

The opposite of this function is “Not IsEmpty”:

  • Not IsEmpty([2022])

If the member «2022» has a value (including 0) it returns «True», if it has no value it returns «False».

This function can be used with a conditional structure:

  • IIF(IsEmpty([2022]), x, y)

Another example:

  • Case
    • When IsEmpty(Expression) then x
    • Else y
  • End

In both cases, if the member «2022» is empty, it assigns «x»; if it has value it assigns “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 2022 including the following formula in the member “Obj_2022” (of the dynamic dimension “Years”):

  • Case
    • When Is([Data].currentmember, “Sales”) then
      • IIF((IsEmpty([2021]) or [2021] = 0), 100, 150)
  • End

This expression assigns the sales target for 2022:

  • When the member «2021» is empty or is zero, it assigns a target of 100
  • When the member «2021» has a value other than zero, it assigns a target of 150

ANALYSIS PROPOSAL

We have tried to use the ISEMPTY function with 2 dimensions without success:

  • IsEmpty(CrossJoin({Dimension A},{Dimension B}))

We analyze the following assumption: we want to set the sales target for 2022, establishing a target of 100 for those markets that in 2021 did not have profit data (#missing); for the rest of markets we set a target of 150.

  • IIF(IsEmpty(CrossJoin({[2021]},{[Benefits]})),100,150)

In the different tests carried out, this function has given us an error when combining these 2 dimensions.

After different tests we have achieved the objective sought using an alternative structure:

  • Case
    • When Is([Data].currentmember, “Sales”) then
      • IIF(((([Data].[Profit],[Years].[2021]).VALUE >0) OR (([Data].[Profit],[Years].[2021]).VALUE <0 )),150,100)
  • End

Assign the 2022 sales target:

  • A target of 150 is assigned to markets with non-zero profit in 2021.
  • A target of 100 is assigned to markets with zero profit or no profit data (#missing) in 2021.

Curiously we have to set the two conditions (>0 and <0) separately; If we unify them in a single condition, it does not recognize #missing and gives them the same treatment as non-zero values:

  • IIF((([Data].[Profit],[Years].[2021]).VALUE <>0),150,100)

Finally, if we want to give a different treatment to #missing, zero and the rest of values, the formula becomes more complicated:

  • Case
    • When Is([Data].currentmember, “Sales”) then
      • IIF((([Data].[Profit],[Years].[2021]).VALUE <>0), IIF(((([Data].[Profit],[Years].[2021]). VALUE >0) OR (([Data].[Profit],[Years].[2021]).VALUE <0)),150,50),100)
  • End

Assign the 2022 sales target:

  • A target of 150 is assigned to markets with non-zero profit in 2021.
  • A target of 100 is assigned to markets with zero profit in 2021.
  • A target of 50 is assigned to markets without profit data in 2021 (#missing).

We appreciate any comments on this.

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

Español

Es una función booleana que devuelve “Verdadero” si la celda está vacía (#missing)  y “Falso” si no lo está.

Su estructura:

  • IsEmpty (Expresión)

Por ejemplo:

  • IsEmpty([2022])

Si el miembro “2022” no tiene valor devuelve “Verdadero”, si tiene valor (incluido el 0) devuelve “Falso”.

Si queremos incluir también el valor 0 tenemos que unir 2 condiciones:

  • IsEmpty([2022]) OR [2022] = 0

El contrario de esta función es “Not IsEmpty”:

  • Not IsEmpty([2022])

Si el miembro “2022” tiene valor (incluido el 0) devuelve “Verdadero”, si no tiene valor devuelve “Falso”.

Esta función se puede utilizar dentro de una estructura condicional:

  • IIF(IsEmpty([2022]), x, y)

Otro ejemplo:

  • Case
    • When IsEmpty(Expresión) then x
    • Else y
  • End

En ambos casos si el miembro “2022” está vacío da el resultado “x”; si tiene valor da el resultado “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 Is([Datos].currentmember, “Ventas”) then
      • IIF((IsEmpty([2021]) or [2021] = 0), 100, 150)
  • End

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

  • Cuando el miembro “2021” está vacío o tiene valor 0 asigna un objetivo de 100
  • Cuando el miembro “2021” tiene un valor distinto de 0 asigna un objetivo de 150

PROPUESTA DE ANÁLISIS

Hemos intentado utilizar la función ISEMPTY con 2 dimensiones sin éxito:

  • IsEmpty(CrossJoin({Dimensión A},{Dimensión B}))

Analizamos el siguiente supuesto: queremos fijar el objetivo de ventas del año 2022, estableciendo un objetivo de 100 para aquellos mercados que en 2021 no tuvieran dato de beneficios (#missing); para el resto de mercados establecemos un objetivo de 150.

  • IIF(IsEmpty(CrossJoin({[2021]},{[Beneficios]})),100,150)

En las diferentes pruebas realizadas esta función nos ha dado error al combinar estas 2 dimensiones.

Después de diversos ensayos hemos conseguido el objetivo buscado utilizando una estructura alternativa:

  • Case
    • When Is([Datos].currentmember, “Ventas”) then
      • IIF(((([Datos].[Beneficio],[Años].[2021]).VALUE >0) OR (([Datos].[Beneficio],[Años].[2021]).VALUE <0)),150,100)
  • End

Asigna el objetivo de ventas de 2022:

  • A los mercados con beneficio en 2021 distinto de cero les asigna un objetivo de 150.
  • A los mercados con beneficio cero en 2021 o sin dato de beneficio (#missing) les asigna un objetivo de 100.

Curiosamente tenemos que establecer las dos condiciones (>0 y <0) por separado; si las unificamos en una única condición no reconoce los #missing y les da el mismo tratamiento que a los valores distintos de cero:

  • IIF((([Datos].[Beneficio],[Años].[2021]).VALUE <>0),150,100)

Por último, si queremos dar un tratamiento diferenciado al #missing, al cero y al resto de valores, la fórmula se complica:

  • Case
    • When Is([Datos].currentmember, “Ventas”) then
      • IIF((([Datos].[Beneficio],[Años].[2021]).VALUE <>0), IIF(((([Datos].[Beneficio],[Años].[2021]).VALUE >0) OR (([Datos].[Beneficio],[Años].[2021]).VALUE <0)),150,50),100)
  • End

Asigna el objetivo de ventas de 2022:

  • A los mercados con beneficio en 2021 distinto de cero les asigna un objetivo de 150.
  • A los mercados con beneficio cero les asigna un objetivo de 100.
  • A los mercados sin dato de beneficio en 2021 (#missing) les asigna un objetivo de 50.

Agradecemos cualquier comentario al respecto.

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

Anuncio publicitario