Returns the first member in the specified level matching the specified member key.
In our example, we return the [United States] of the hierarchy [Economy].
Query
LookupByKey([Geography].[Economy].[Country],[Geography].[Economy].[United States].key)
Result
{
[Geography].[Economy].[Country].[United States]
}
Assertion : MDX Equals
[Geography].[Economy].[United States]
Assertion : MDX Equals
strToMember( "[Geography].[Economy].&[" + [Geography].[Economy].[United States].key + "]" )
Returns the first member in the specified hierarchy matching the specified member key.
In our example, we return the [United States] of the hierarchy [Economy].
Query
LookupByKey([Geography].[Economy],[Geography].[Economy].[United States].key)
Result
{
[Geography].[Economy].[Country].[United States]
}
Assertion : MDX Equals
[Geography].[Economy].[United States]
Assertion : MDX Equals
strToMember( "[Geography].[Economy].&[" + [Geography].[Economy].[United States].key + "]" )
Returns the first member in the specified hierarchy matching the specified member key.
In our example, we return the [United States] of the hierarchy [Economy].
Query
LookupByKey([Geography].[Economy],[Geography].[Economy].[United States])
Result
{
[Geography].[Economy].[Country].[United States]
}
Assertion : MDX Equals
[Geography].[Economy].[United States]
Assertion : MDX Equals
strToMember( "[Geography].[Economy].&[" + [Geography].[Economy].[United States].key + "]" )
Returns a list of matching members for each member of the second parameter.
In our example, we return the [United States] of the hierarchy [Economy].
Query
LookupByKey([Geography].[Economy],{[Geography].[Economy].[United States],[Geography].[Economy].[France]} )
Result
{
[Geography].[Economy].[Country].[United States],
[Geography].[Economy].[Country].[France]
}
Assertion : MDX Equals
{[Geography].[Economy].[United States],[Geography].[Economy].[France]}
Returns the first member in the specified hierarchy matching the specified member key without converting
the key.
In our example, we return the [United States] of the hierarchy [Economy].
Query
LookupByKey([Geography].[Economy],[Geography].[Economy].[United States].key,TYPED)
Result
{
[Geography].[Economy].[Country].[United States]
}
Assertion : MDX Equals
[Geography].[Economy].[United States]
Assertion : MDX Equals
strToMember( "[Geography].[Economy].&[" + [Geography].[Economy].[United States].key + "]" )
Returns NULL if there is no matching member in the specified level.
In our example, there is no member in level [Continent] with key '232'.
Query
LookupByKey([Geography].[Continent],232)
Result
Assertion : MDX Equals
LookupByKey([Geography].[Continent],"232")
Assertion : MDX Equals
LookupByKey([Geography].[Continent],3.24)