Skip to main content
Version: I2023.3.0

Mid

Syntax

MID(string, start, length)

Input Parameters

String (Required)
String expression from which the rightmost characters are returned. If string is NULL, NULL is returned.

Start (Required)
Integer Character position in string at which the part to be taken begins. If start is greater than the number of characters in string, Mid returns a zero-length string ("").

Length (Optional)
An integer indicating the number of characters to return. If omitted or if there are fewer than length characters in the text (including the character at start), all characters from the start position to the end of the string are returned.

Return Value

Returns a String containing a specified number of characters from a string.

Example

Return the 4 characters from the member's name starting at character 3 as a string.

MID([Order Date Dimension].[Order Retail445].currentMember.NAME, 3, 4)