@SUBSTRING

The @SUBSTRING calculation function for Essbase returns the requested string of characters from an existing source string.

The source string can be a text string or a member name, or it can result from a specified function that returns a text string or a single member name.

Syntax

@SUBSTRING (String, StartPosition [, EndPosition])

Parameters

String

A string or a function that returns a string or a single member name (For example, @ATTRIBUTESVAL, @CONCATENATE, and @NAME return strings.)

StartPosition

Beginning character position within String to include in the substring. An integer greater than or equal to 0, where 0 corresponds to the first character in String, 1 corresponds to the second character, and so on.

EndPosition

Optional. An integer greater than or equal to 1, where 1 corresponds to the first character in String, 2 corresponds to the second character, and so on. If EndPosition is not specified or is less than StartPosition, Essbase returns all remaining characters from the source string. Note that this is a different numbering scheme that the start position uses.

Example

The following examples are based on the Sample Basic database:

Table 2-32 @SUBSTRING Examples and Results

Function Statement Result
@SUBSTRING ("100-10",1) "00-10"
@SUBSTRING ("200-21",0,2) "20"

@SUBSTRING (@Name(@Parent(Jan)),3)

(The parent of Jan is Qtr1.)

"1"