English (Español a continuación)
This function can be used with attribute dimensions type numeric or date, and allows to extract the numeric value of the attribute assigned to the members of the base dimension.
Its structure consists of a single parameter:
- @ATTRIBUTEVAL (A);
Part «A»: the attribute dimension from which we extract the numerical value of the attribute associated with the members of the base dimension.
- If a member level 0 of the base dimension does not have an attribute associated with this attribute dimension, this function returns «#missing».
- If it is a date attribute, this function returns the number of seconds elapsed since January 1, 1970.
For example: the database of a travel agency includes a base dimension “Destination” that has associated a numeric attribute dimension “Days”. This database has the variable “Price” informed and we want to calculate the variable “Price / Day”:

We can use this function:
- “Price / Day” = Price / @ATTRIBUTEVAL (Days);
Obtaining the following result:

When using a date attribute dimension, to compare it with another date Essbase performs this comparison by calculating the numerical value of the dates. To do this, Essbase converts the comparison date into a numeric value using the function @TODATE.
- Its structure consists of two parameters: @TODATE (A, B);
Part “A”: defines the format of the date included in Part “B”. It can be of 2 types: “mm-dd-yyyy” or “dd-mm-yyyy”.
Part “B”: comparison date: for example, “06-10-2020”.
- This date must be included in the range «01-01-1970» to «01-01-2037»
Let’s see an example: considering a watchmaker:

We will set the sales target for each product based on its commercial launch date:
- «Sales_target»
- IF (@ATRIBUTEVAL (“Commercial launch date”) > @TODATE (“mm-dd-yyyy”, ”06-01-2020))
- Sales * 1.2;
- ELSEIF (@ATRIBUTEVAL (“Commercial launch date”) > @TODATE (“mm-dd-yyyy”, ”12-01-2020))
- Sales * 1.1;
- ELSE
- Sales:
- ENDIF
- )
Any question, please send an email to: essbaseeasy@gmail.com
Español
Esta función se puede utilizar con dimensiones atributos de tipo numérico o fecha, y permite extraer el valor numérico del atributo asignado a los miembros de la dimensión base.
Su estructura consta de un único parámetro:
- @ATTRIBUTEVAL(A);
Parte “A”: es la dimensión atributo de la que vamos a extraer el valor numérico del atributo asociado a los miembros de la dimensión base.
- Si un miembro de nivel 0 de la dimensión base no tiene asociado un atributo de esta dimensión atributo, esta función devuelve “#missing”.
- Si el atributo es del tipo “fecha”, esta función devuelve el número de segundos transcurridos desde el 1 de enero de 1970.
Por ejemplo: supongamos la base de datos de una agencia de viajes incluye una dimensión base “Destino” que tiene asociada una dimensión atributos “Días” de tipo numérico. Esta base tiene informada la variable “Precio” y queremos calcular la variable “Precio / Día”:

Podemos utilizar esta función:
- “Precio / Día” = Precio / @ATTRIBUTEVAL(Días);
Obteniendo el siguiente resultado:

Cuando se utilizan atributos tipo fecha y se comparan con otra fecha Essbase realiza esta comparación calculando el valor numérico de las fechas. Para ello, la fecha de comparación tenemos que convertirla en valor numérico utilizando la función @TODATE.
- Su estructura consta de dos parámetros: @TODATE(A, B);
Parte “A”: recoge el formato de la fecha que vamos a incluir en la Parte “B”. Puede ser de 2 tipos: “mm-dd-yyyy” o “dd-mm-yyyy”.
Parte “B”: fecha de comparación: por ejemplo, “06-10-2020”.
- Esta fecha debe estar incluida en el rango “01-01-1970” a “01-01-2037”
Veamos un ejemplo: supongamos un fabricante de relojes:

Vamos a fijar el objetivo de ventas de cada producto en función de la fecha de su lanzamiento:
- “Obj_ventas”
- IF(@ATRIBUTEVAL(Lanzamiento) > @TODATE(“mm-dd-yyyy”,”06-01-2020))
- Ventas * 1.2;
- ELSEIF(@ATRIBUTEVAL(Lanzamiento) > @TODATE(“mm-dd-yyyy”,”12-01-2020))
- Ventas * 1.1;
- ELSE
- Ventas:
- ENDIF
- )
Cualquier consulta envía, por favor, un correo a: essbaseeasy@gmail.com