Converts a string to a member name.
Syntax
StrToMbr ( string [, dimension ] [, MEMBER_NAMEONLY | alias_table_name ] )
Parameter | Description |
---|---|
string | Input string. |
dimension | Optional dimension specification. If used, only member names found in this dimension will be returned. |
MEMBER_NAMEONLY | Optional. Create member name only out of member names found (not including aliases). The default is to search for member names and all aliases. |
alias_table_name | Optional. Create member name only out of alias name strings found. The default is to search for member names and all aliases. |
Notes
You can also use member properties as string input. These properties include MEMBER_NAME, MEMBER_UNIQUE_NAME, MEMBER_ALIAS, ANCESTOR_NAMES, and COMMENTS. For example:
SELECT {StrToMbr(Sales.MEMBER_NAME)} ON COLUMNS FROM Sample.Basic
Example
SELECT { StrToMbr("CA" , [Geography], "Default") } ON COLUMNS, Children([High End Merchandise]) ON ROWS FROM Asosamp.Sample
returns CA.
SELECT { StrToMbr("Quarter1" , [Year], MEMBER_NAMEONLY) } DIMENSION PROPERTIES [YEAR].[MEMBER_ALIAS] ON COLUMNS, Children([100]) ON ROWS FROM Sample.Basic
returns nothing, because "Quarter1" is an alias.
SELECT { StrToMbr("Qtr1" , [Year], MEMBER_NAMEONLY) } DIMENSION PROPERTIES [YEAR].[MEMBER_ALIAS] ON COLUMNS, Children([100]) ON ROWS FROM Sample.Basic
returns Qtr1.
SELECT { StrToMbr("Quarter1" , [Year], "Long Names") } DIMENSION PROPERTIES [YEAR].[MEMBER_ALIAS] ON COLUMNS, Children([100]) ON ROWS FROM Sample.Basic
returns Qtr1 because "Quarter1" is in the "Long Names" alias table.