ISMATCH

English (Español a continuación)

This function allows to select those members whose names / aliases / attributes include a certain pattern.

Structure:

  • IsMatch(Member, Pattern, [MATCH_CASE / IGNORE_CASE]

a) Member: it can be defined by its name / alias / attribute.

b) Pattern: defines the sequence of characters that the selected members have to present.

c) MATCH_CASE / IGNORE_CASE: is optional; if MATCH_CASE is included the search is case sensitive; if IGNORE_CASE is included the search is not case sensitive.

  • If it is not included, Essbase applies by default the case sensitive option of the outline (activated or not).

Let’s see some examples: considering the “Markets” dimension:

  • IsMatch(Markets.CurrentMember.MEMBER_NAME,»EUR»)

This formula selects those members of the “Markets” dimension whose names include the sequence “EUR”.

  • IsMatch(Markets.CurrentMember.MEMBER_ALIAS,»Area»)

This formula selects those members of the “Markets” dimension whose aliases include the sequence “Area”.

This formula can also be used in negative to select those members that do not contain a certain pattern:

  • Not IsMatch(Markets.CurrentMember.MEMBER_ALIAS,»Area»)

This formula selects those members of the “Markets” dimension whose aliases do NOT include the “Area” sequence.

Some particularities:

  • To select those members that start with a certain string, the pattern definition has to start with the character “^”.
    • For example, to select those members that start with “ZAP”, the pattern is defined as “^ZAP”.
  • To select those members that end with a certain string, the pattern definition must end with the “$” character.
    • For example, to select those members that end with «ZAP», the pattern is defined as «ZAP$».
  • To select those members that contain a specific string that is repeated 1 or more times, the definition of the pattern is followed by the + symbol.
    • For example, to select those members whose names contain the character “X” one or more times, the pattern is defined as “X+”.
  • To select those members that contain a certain string that is repeated a certain number of times, we will put {n} after the string (where “n” is the number of repetitions).
    • For example, to select those members that contain three «X» in a row, we can define the pattern «XXX» or the pattern «X{3}». (After the three «X» there may be another «X» or any other character).
  • To select those members that contain a certain string in which any alphabetic character can appear in a specific position, we will define that position within the pattern with the sequence [a-z].
    • For example, to select those members that begin with any letter followed by “ZAP”, the pattern is defined as “[a-z]ZAP”.
  • To select those members that contain a certain string in which any number can appear in a specific position, we will define that position within the pattern with the sequence [0-9].
    • For example, to select those members that start with any number followed by “ZAP”, the pattern is defined as “[0-9]ZAP”.
  • To select those members that contain a certain string in which any number or alphabetic character can appear in a specific position, we will define that position within the pattern with the sequence [a-z0-9].
    • For example, to select those members that start with any number or letter followed by “ZAP”, the pattern is defined as “[a-z0-9]ZAP”.
  • To select those members that contain a certain string that is repeated a certain number of times (in a row or not) the definition of the pattern: “Pattern([a z0-9]?)+”.
    • The symbol “?” indicates that the previous character [a-z0-9] may or may not appear; is enclosed in parentheses followed by the “+” symbol to indicate that this string “[a-z0-9]?” can be repeated 1 or more times.
    • For example, to select those members that contain at least three “X” (in a row or not), the pattern is defined as “(X([a-z0-9]?)+){3}”.
  • To select those members that contain a certain string repeated a certain number of times (separately) the definition of the pattern: “Pattern[a z0-9]+”.
    • For example, to select those members that contain at least three separate “X’s”, the pattern is defined as “(X[a-z0-9]+){3}”.
  • If the member contains the “$” character in the pattern definition, this sign must be preceded by 3 “\”.
    • For example, to select those members that include “PRICE$S” the pattern must be defined as “PRICE\\\$S”
  • If the member contains any other special character than “$” in the pattern definition, this sign must be preceded by 2 “\”.
    • For example, to select those members that include “PRICE%S” the pattern must be defined as “PRICE\\%S”

This formula can be used in a conditional structure:

For example:

  • Case
    • When IsMatch(Mercados.CurrentMember.MEMBER_ALIAS,”ESP”)  or IsMatch(Mercados.CurrentMember.MEMBER_ALIAS,”EUR”) THEN Sales * 1.5
    • ELSE Sales * 1.3
  • End

Calculate the value of “Obj_2022”:

  • For the members of the «Markets» dimension that contain the pattern «ESP» or «EUR» in their aliases: Multiplying their sales by 1.5
  • For the rest of the members of the «Markets» dimension: Multiplying their sales by 1.3M

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

Español

Esta función permite seleccionar aquellos miembros cuyos nombres / alias / atributos incluyen un patrón determinado.

Estructura:

  • IsMatch(Miembro, Patrón, [MATCH_CASE / IGNORE_CASE]

a) Miembro: puede venir definido por su nombre / alias / atributo.

b) Patrón: define la secuencia de caracteres que tienen que presentar los miembros seleccionados.

c) MATCH_CASE / IGNORE_CASE: es optativo; si se incluye MATCH_CASE la búsqueda es case sensitive; si se incluye  IGNORE_CASE la búsqueda no es case sensitive.

  • Si no se incluye Essbase aplica por defecto la opción case sensitive (activada o no) que tenga el outline.

Veamos algunos ejemplos: suponiendo que buscamos en la dimensión “Mercados”:

  • IsMatch(Mercados.CurrentMember.MEMBER_NAME,”EUR”)

Esta fórmula selecciona aquellos miembros de la dimensión “Mercados” cuyos nombres incluyen la secuencia “EUR”.

  • IsMatch(Mercados.CurrentMember.MEMBER_ALIAS,”Area”)

Esta fórmula selecciona aquellos miembros de la dimensión “Mercados” cuyos alias incluyen la secuencia “Area”.

Esta fórmula también se puede utilizar en negativo para seleccionar aquellos miembros que no contengan un patrón determinado:

  • Not IsMatch(Mercados.CurrentMember.MEMBER_ALIAS,”Area”)

Esta fórmula selecciona aquellos miembros de la dimensión “Mercados” cuyos alias NO incluyen la secuencia “Area”.

Algunas particularidades:

  • Para seleccionar aquellos nombres que comiencen por una cadena determinada, la definición del patrón tiene que comenzar con el carácter “^”.
    • Por ejemplo, para seleccionar aquellos productos que comiencen por “ZAP”, el patrón se define “^ZAP”.
  • Para seleccionar aquellos nombres que finalicen por una cadena determinada, la definición del patrón tiene que finalizar con el carácter “$”.
    • Por ejemplo, para seleccionar aquellos productos que finalicen por “ZAP”, el patrón se define “ZAP$”.
  • Para seleccionar aquellos nombres que contengan una cadena determinada que se repita 1 o más veces, la definición del patrón va seguida del símbolo +.
    • Por ejemplo, para seleccionar aquellos productos cuyos nombres contengan el carácter “X” una o más veces, el patrón se define “X+”.
  • Para seleccionar aquellos nombres que contengan una cadena determinada que se repita un número determinado de veces, a continuación de la cadena pondremos {n} (siendo “n” el número de repeticiones).
    • Por ejemplo, para seleccionar aquellos productos que contengan tres “X” seguidas, podremos definir el patrón “XXX” o el patrón “X{3}”. (A continuación de las tres “X” podrá haber otra “X” o cualquier otro carácter).
  • Para seleccionar aquellos nombres que contengan una cadena determinada en la que en una posición específica puede aparecer cualquier carácter alfabético, esa posición la definiremos dentro del patrón con la secuencia [a-z].
    • Por ejemplo, para seleccionar aquellos productos que comiencen por cualquier letra seguida de “ZAP”, el patrón se define “[a-z]ZAP”.
  • Para seleccionar aquellos nombres que contengan una cadena determinada en la que en una posición específica puede aparecer cualquier número, esa posición la definiremos dentro del patrón con la secuencia [0-9].
    • Por ejemplo, para seleccionar aquellos productos que comiencen por cualquier número seguida de “ZAP”, el patrón se define “[0-9]ZAP”.
  • Para seleccionar aquellos nombres que contengan una cadena determinada en la que en una posición específica puede aparecer cualquier número o carácter alfabético, esa posición la definiremos dentro del patrón con la secuencia [a-z0-9].
    • Por ejemplo, para seleccionar aquellos productos que comiencen por cualquier número o letra seguido de “ZAP”, el patrón se define “[a-z0-9]ZAP”.
  • Para seleccionar aquellos nombres que contengan una cadena determinada que se repita un número determinado de veces (continua o separada) la definición del patrón: “Patrón([a z0-9]?)+”.
    • El símbolo “?” indica que el carácter anterior [a-z0-9] puede aparecer o no; se incluye entre paréntesis seguido del símbolo “+” para indicar que esta cadena “[a-z0-9]?” se puede repetir 1 o más veces.
    • Por ejemplo, para seleccionar aquellos productos que contengan al menos tres “X” (continuas o separadas), el patrón se define “(X([a-z0-9]?)+){3}”.
  • Para seleccionar aquellos nombres que contengan una cadena determinada que se repita un número determinado de veces (separada) la definición del patrón: “Patrón[a z0-9]+”.
    • Por ejemplo, para seleccionar aquellos productos que contengan al menos tres “X” separadas, el patrón se define “(X[a-z0-9]+){3}”.
  • Si el miembro contiene el signo “$” en la definición del patrón este signo tiene que ir precedido por 3 “\”.
    • Por ejemplo, para seleccionar aquellos nombres que incluyan “PRICE$S” el patrón tiene que venir definido “PRICE\\\$S”
  • Si el miembro contiene cualquier otro carácter especial distinto de “$” en la definición del patrón este signo tiene que ir precedido por 2 “\”.
    • Por ejemplo, para seleccionar aquellos nombres que incluyan “PRICE%S” el patrón tiene que venir definido “PRICE\\%S”

Está fórmula la podemos utilizar en una estructura condicional:

Example:

  • Case
    • When IsMatch(Mercados.CurrentMember.MEMBER_ALIAS,”ESP”)  or IsMatch(Mercados.CurrentMember.MEMBER_ALIAS,”EUR”) THEN Sales * 1.5
    • ELSE Sales * 1.3
  • End

Calcula el valor de “Obj_2022”:

  • Para los miembros de la dimensión “Mercados” que contienen en sus alias el patrón “ESP” o «EUR»: Multiplicando sus ventas por 1,5
  • Para el resto de los miembros de la dimensión “Mercados”:  Multiplicando sus ventas por 1,3M

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

Anuncio publicitario