English (Español a continuación)
It is a «string» type function that detects if a string ends with a certain suffix.
Its structure consists of 2 parts:
- @CalcMgrEndsWith (text, suffix)
The first part is the text you are going to search in, while the second part is the ending you are going to search for.
If the text ends with this ending it returns «True», otherwise it returns «False».
For example:
- @CalcMgrEndsWith (“MAD_SP”, “SP”) = True
- @CalcMgrEndsWith (“LIS_PT”, “SP”) = False
In the first case it locates the ending «SP» at the end of the text «MAD_SP» and therefore returns «True», while in the second case it does not locate this ending at the end of the text «LIS_PT» so it returns «False».
This function can be used within a conditional structure:
- IF …
- @CalcMgrTextLength
- ENDIF
Let’s see an example: Let’s suppose that we have a product portfolio in which the last two characters indicate the year when began their commercialization:
- AAC_15
- BCCCB_18
- CCCCD_15
- ACX_19
We want to apply a certain margin to those products that began to be marketed in 2015.

This function allows you to select those members of the «Products» dimension whose names end in «15» and apply them a margin of 19%.
Español
Es una función del tipo “string” que detecta si una cadena de caracteres finaliza con un sufijo determinado.
Su estructura consta de 2 partes:
- @CalcMgrEndsWith(text, suffix)
La primera parte es el texto en el que va a realizar la búsqueda, mientras que la segunda parte es la terminación que va a buscar.
Si el texto finaliza con esa terminación devuelve “Verdadero”, en caso contrario devuelve “Falso”.
Por ejemplo:
- @CalcMgrEndsWith(“MAD_SP”, “SP”) = Verdadero
- @CalcMgrEndsWith(“LIS_PT”, “SP”) = Falso
En el primer caso localiza la terminación “SP” al final del texto “MAD_SP” y por tanto devuelve “Verdadero”, mientras que en el segundo caso no localiza esta terminación al final del texto “LIS_PT” por lo que devuelve “Falso”.
Esta función se puede utilizar dentro de una estructura condicional:
- IF…
- @CalcMgrTextLength
- ENDIF
Veamos un ejemplo: Supongamos que tenemos una cartera de productos en la que los dos últimos caracteres indican el año del inicio de su comercialización:
- AAC_15
- BCCCB_18
- CCCCD_15
- ACX_19
Queremos aplicar un margen determinado a aquellos productos que se comenzaron a comercializar en 2015.

Esta función selecciona aquellos miembros de la dimensión “Cuentas” cuyos nombres finalizan en “15” y le aplica un margen del 19%.