Right function (MDX)

The Right function returns a string of a specified number of characters from the right side (end) of a specified string.

Returns: A string.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-Right--(--StringExpression--,--NumericExpression--)---------><

Parameters

StringExpression
Specifies the string whose substring is to be returned.
NumericExpression
Specifies the number of characters to be copied from the original string. If this value is greater than the length of the specified string, the function returns the specified string with no padding added to it.

Example

The following example uses the function to retrieve the sales amount for product departments with a name that ends with the word "JEANS."

Query
SELECT {[Price Analysis].[Measures].[Sales Amount]} ON AXIS(0)

, {Filter([Price Analysis].[Product].[All Products].Children, 

Right([Price Analysis].[Product].CurrentMember.Name, 5) = "JEANS")} ON AXIS(1)

FROM [Price Analysis]
Result
Product Sales Amount
TEEN BOYS JEANS 46876.68
TEEN GIRLS JEANS 52952.56

Related functions

You can use the Left function to get a substring from the beginning of a string.



Feedback | Information roadmap