English (Español a continuación)
This function returns all those members of a base dimension that are assigned those attributes of a certain attribute dimension that meet a certain condition.
Its structure consists of 3 parameters:
- @WITHATTR (A, B, C)
Part “A”: name of the attribute dimension.
Part “B”: It is the operator that determines how the attribute members of the dimension included in part «A» must meet the condition included in part «C»; this operator must be enclosed between » «. The following possibilities are possible:
- > (greater than)
- = (greater than or equal to)
- < (less than)
- <= (less than or equal to)
- == (equal)
- <> (also! =) (Other than)
- IN (within): it is used when the part “C” contains a parent member of the attribute dimension; this operator selects all members levels 0 that depend of that parent.
Part “C”: condition that must be met. It can be the name of an attribute, a constant, or a date format function (@TODATE).
Depending on the type of attribute this function works as follows:
a) Attribute type “text”: The “>” / “<” operators work by ordering the attribute members in alphabetical order.
- @WITHATTR (Size, ”>”, Large); select all those attributes of this dimension that alphabetically follow «Large».
b) Attribute type “boolean”: part “C” can include the name of the attribute (“True” / “False”) or “1” for “True” and “0” for “False”.
- @WITHATTR (Offer, ”<>”, True); it returns only those members that have this attribute «False» (it does not return those members that do not have any attribute assigned).
c) Attribute type «date»: the date included in part «C» must be inside the function @TODATE to convert it into a number.
- @WITHATTR (“Commercial launch”, ”<=”, @TODATE (“03-01-2021”));
The @WITHATTR function is a superset of the @ATTRIBUTE function: example:
- If we consider an attribute dimension «Size» and one of its members «Large», the function @WITHATTR (Size, «==», Large) gives the same result as @ATTRIBUTE (Large).
- On the other hand, the following selection @WITHATTR (Size, ”<>”, Large) cannot be made with the @ATTRIBUTE function.
The @WITHATTR function can be used within other functions that require selecting a list of members.
For instance:
- FIX (@WITHATTR (Size, “==”, Large))
- IF (@ISMBR (@WITHATTR (Size, “==”, Large)))
- …
Any question, please send an email to: essbaseeasy@gmail.com
Español
Esta función devuelve todos aquellos miembros de una dimensión base que tengan asignados aquellos atributos de una determinada dimensión atributo que cumplan determinada condición.
Su estructura consta de 3 parámetros:
- @WITHATTR(A, B, C)
Parte “A”: nombre de la dimensión atributo.
Parte “B”: es el operador que determina como los miembros atributos de la dimensión incluida en la parte “A” deben cumplir la condición recogida en la parte “C”; este operador debe ir incluido entre “ ”. Caben las siguientes posibilidades:
- > (mayor que)
- >= (mayor o igual que)
- < (menor que)
- <= (menor o igual que)
- == (igual)
- <> (también !=) (distinto de)
- IN (dentro de): se utiliza cuando en la parte “C” se recoge un miembro padre de la dimensión atributo; este comparador selecciona todos los niveles 0 que dependan de ese padre.
Parte “C”: Condición que debe cumplir. Puede ser el nombre de un atributo, una constante, o una función formato de fecha (@TODATE).
Según el tipo de atributo esta función funciona de la siguiente manera:
a) Atributo tipo “texto”: Los operadores “>” / “<” funcionan ordenando los miembros atributos por orden alfabético.
- @WITHATTR(Tamaño,”>”,Grande); selecciona todos aquellos atributos de esta dimensión que alfabéticamente vayan a continuación de “Grande”.
b) Atributo tipo “booleano”: en esta función se puede recoger el nombre del miembro (“True” / “False”) o “1” para “True” y “0” para “False”.
- @WITHATTR(Oferta,”<>”,True); devuelve únicamente aquellos miembros que tengan el atributo “False” (no devuelve aquellos miembros que no tengan asignado atributo).
c) Atributo tipo “fecha”: la fecha que se incluye en la parte “C” debe ir dentro de la función @TODATE para convertirla en un número.
- @WITHATTR(Lanzamiento,”<=”, @TODATE(“03-01-2021”));
La función @WITHATTR es una función más amplia que la función @ATTRIBUTE: ejemplo:
- Si consideramos una dimensión atributo “Tamaño” y uno de sus miembros “Grande”, la función @WITHATTR(Tamaño,”==”,Grande) da el mismo resultado que @ATTRIBUTE(Grande).
- En cambio la siguiente selección @WITHATTR(Tamaño,”<>”,Grande) no se puede realizar con la función @ATTRIBUTE.
La función @WITHATTR se puede utilizar dentro de otras funciones que requieran seleccionar una lista de miembros.
Por ejemplo:
- FIX(@WITHATTR(Tamaño, “==”,Grande))
- IF(@ISMBR(@WITHATTR(Tamaño, “==”,Grande)))
- …
Cualquier consulta envía, por favor, un correo a: essbaseeasy@gmail.com