English (Español a continuación)
It is a «string» type function that gives us the length of a character string.
For example:
- @CalcMgrTextLength («January») = 7
This function can be useful when we want to extract part of the character string.
Suppose we have a dimension «Accounts» with members whose names have different lengths and whose last two characters indicate the margin applied to them:
- AAC_15
- BCCCB_18
- ACCCCD_17
- ACX_19
We are interested in extracting the last two characters to obtain the margin applied to each one of them.
For this we can use this function in combination with other “stirng” type functions. Let’s analyze the following calculation:

The @CURRMBR (Accounts) function selects the member of the “Accounts” dimension that is being calculated; will be successively:
- AAC_15
- BCCCB_18
- ACCCCD_17
- ACX_19
The @NAME (@CURRMBR (Accounts)) function selects the name of these members:
- «AAC_15»
- «BCCCB_18»
- «ACCCCD_17»
- «ACX_19»
The function @CalclMgrTextLength (@NAME (@CURRMBR (Accounts))) gets the length of the character string of these names:
- @CalclMgrTextLength (“AAC_15”) = 6
- @CalclMgrTextLength (“BCCCB_18”) = 8
- @CalclMgrTextLength (“ACCCCD_17”) = 9
- @CalclMgrTextLength (“ACX_19”) = 6
We subtract 2 from the number obtained:
- @CalclMgrTextLength (“AAC_15”) – 2 = 4
- @CalclMgrTextLength (“BCCCB_18”) – 2 = 6
- @CalclMgrTextLength (“ACCCCD_17”) – 2 = 7
- @CalclMgrTextLength (“ACX_19”) – 2 = 4
The function @SUBSTRING (@NAME (@CURRMBR (Accounts)), @ CalclMgrTextLength ()) obtains from the indicated text string “@NAME (@CURRMBR (Accounts))” the characters from the indicated position to the end:
- @SUBSTRING (“AAC_15”, 4) = “15”
- @SUBSTRING (“BCCCB_18”, 6) = “18”
- @SUBSTRING (“ACCCCD_17”, 7) = “17”
- @SUBSTRING (“ACX_19”, 4) = “19”
Finally, the @CalclMgrDoubleFromString function converts the obtained character string into a number:
- @CalclMgrDoubleFromString (@SUBSTRING (“AAC_15”, 4)) = 15
- @CalclMgrDoubleFromString (@SUBSTRING (“BCCCB_18”, 6)) = 18
- @CalclMgrDoubleFromString (@SUBSTRING (“ACCCCD_17”, 7)) = 17
- @CalclMgrDoubleFromString (@SUBSTRING (“ACX_19”, 4)) = 19
Español
Es una función del tipo “string” que nos da la longitud de una cadena de caracteres.
Por ejemplo:
- @CalcMgrTextLength (“Enero”) = 5
Esta función puede ser útil cuando nos interesa extraer parte de la cadena de caracteres.
Supongamos que tenemos una dimensión “Cuentas” con miembros cuyos nombres tienen distintas longitudes y cuyos dos últimos caracteres indican el margen que se les aplica:
- AAC_15
- BCCCB_18
- ACCCCD_17
- ACX_19
Nos interesa extraer los dos últimos caracteres para obtener el margen aplicado a cada uno de ellos.
Para ello podemos utilizar esta función en combinación con otras funciones de tipo “stirng”. Analicemos el siguiente cálculo:

La función @CURRMBR(Cuentas) selecciona el miembro de la dimensión “Cuentas” que se está calculando; será sucesivamente:
- AAC_15
- BCCCB_18
- ACCCCD_17
- ACX_19
La función @NAME(@CURRMBR(Cuentas)) selecciona el nombre de estos miembros:
- “AAC_15”
- “BCCCB_18”
- “ACCCCD_17”
- “ACX_19”
La función @CalclMgrTextLength(@NAME(@CURRMBR(Cuentas))) obtiene la longitud de la cadena de caracteres de estos nombres:
- @CalclMgrTextLength(“AAC_15”) = 6
- @CalclMgrTextLength(“BCCCB_18”) = 8
- @CalclMgrTextLength(“ACCCCD_17”) = 9
- @CalclMgrTextLength(“ACX_19”) = 6
Al número obtenido le restamos 2:
- @CalclMgrTextLength(“AAC_15”) – 2 = 4
- @CalclMgrTextLength(“BCCCB_18”) – 2 = 6
- @CalclMgrTextLength(“ACCCCD_17”) – 2 = 7
- @CalclMgrTextLength(“ACX_19”) – 2 = 4
La función @SUBSTRING(@NAME(@CURRMBR(Cuentas)),@CalclMgrTextLength( )) obtiene de la cadena de texto indicada “@NAME(@CURRMBR(Cuentas))” los caracteres desde la posición indicada hasta el final:
- @SUBSTRING(“AAC_15”,4) = “15”
- @SUBSTRING(“BCCCB_18”,6) = “18”
- @SUBSTRING(“ACCCCD_17”,7) = “17”
- @SUBSTRING(“ACX_19”,4) = “19”
Por último, la función @CalclMgrDoubleFromString convierte la cadena de caracteres obtenida en un número:
- @CalclMgrDoubleFromString(@SUBSTRING(“AAC_15”,4)) = 15
- @CalclMgrDoubleFromString (@SUBSTRING(“BCCCB_18”,6)) = 18
- @CalclMgrDoubleFromString(@SUBSTRING(“ACCCCD_17”,7)) = 17
- @CalclMgrDoubleFromString(@SUBSTRING(“ACX_19”,4)) = 19