Returns all children of the members, in the example [America] children.
Query
Descendants([Geography].[Geo].[America],1)
Result
{
[Geography].[Geo].[Country].[Canada],
[Geography].[Geo].[Country].[Mexico],
[Geography].[Geo].[Country].[United States],
[Geography].[Geo].[Country].[Venezuela]
}
Assertion : MDX Equals
Descendants([Geography].[Geo].[America],[Geography].[Geo].[Country])
Assertion : MDX Equals
[Geography].[Geo].[America].children
Returns all children of the set members, in the example [Europe] and [America] children.
Query
Descendants({[Geography].[Geo].[Europe],[Geography].[Geo].[America]},1)
Result
{
[Geography].[Geo].[Country].[France],
[Geography].[Geo].[Country].[Spain],
[Geography].[Geo].[Country].[Switzerland],
[Geography].[Geo].[Country].[Canada],
[Geography].[Geo].[Country].[Mexico],
[Geography].[Geo].[Country].[United States],
[Geography].[Geo].[Country].[Venezuela]
}
Assertion : MDX Equals
[Geography].[Geo].[Europe].children + [Geography].[Geo].[America].children
Assertion : MDX Equals
Descendants({[Geography].[Geo].[Europe],[Geography].[Geo].[America]},[Geography].[Geo].[Country])
Returns the next two levels descendants of the member, in the example [America] children and grandchildren.
Query
Descendants([Geography].[Geo].[America],2)
Result
{
[Geography].[Geo].[City].[Quebec],
[Geography].[Geo].[City].[Toronto],
[Geography].[Geo].[City].[Mexico],
[Geography].[Geo].[City].[Los Angeles],
[Geography].[Geo].[City].[New York],
[Geography].[Geo].[City].[San Francisco],
[Geography].[Geo].[City].[Caracas]
}
Assertion : MDX Equals
Descendants([Geography].[Geo].[America],[Geography].[Geo].[City])
Assertion : MDX Equals
Descendants([Geography].[Geo].[America],55)
Assertion : MDX Equals
Generate( [Geography].[Geo].[America].children, [Geography].[Geo].CurrentMember.children)
Returns all descendants at the given level, in our example [America] descendants which are at level [Country].
Query
Descendants([Geography].[Geo].[America],[Geography].[Geo].[Country])
Result
{
[Geography].[Geo].[Country].[Canada],
[Geography].[Geo].[Country].[Mexico],
[Geography].[Geo].[Country].[United States],
[Geography].[Geo].[Country].[Venezuela]
}
Assertion : MDX Equals
Descendants([Geography].[Geo].[America],1)
Assertion : MDX Equals
[Geography].[Geo].[America].children
Assertion : MDX Equals
Filter([Geography].[Geo].[Country].members, [Geography].[Geo].CurrentMember.Parent IS [Geography].[Geo].[America])
Returns all descendants of the members, including itself.
Query
Descendants([Geography].[Geo].[America])
Result
{
[Geography].[Geo].[Continent].[America],
[Geography].[Geo].[Country].[Canada],
[Geography].[Geo].[City].[Quebec],
[Geography].[Geo].[City].[Toronto],
[Geography].[Geo].[Country].[Mexico],
[Geography].[Geo].[City].[Mexico],
[Geography].[Geo].[Country].[United States],
[Geography].[Geo].[City].[Los Angeles],
[Geography].[Geo].[City].[New York],
[Geography].[Geo].[City].[San Francisco],
[Geography].[Geo].[Country].[Venezuela],
[Geography].[Geo].[City].[Caracas]
}
Assertion : MDX Equals
Hierarchize({[Geography].[Geo].[America] } + Descendants([Geography].[Geo].[America],1) + Descendants([Geography].[Geo].[America],2))
Returns all descendants before the given level including itself, in our example [America] and it's children.
Query
Descendants([Geography].[Geo].[America],[Geography].[Geo].[City],BEFORE)
Result
{
[Geography].[Geo].[Continent].[America],
[Geography].[Geo].[Country].[Canada],
[Geography].[Geo].[Country].[Mexico],
[Geography].[Geo].[Country].[United States],
[Geography].[Geo].[Country].[Venezuela]
}
Assertion : MDX Equals
{[Geography].[Geo].[America],[Geography].[Geo].[America].children}
Assertion : MDX Equals
Descendants([Geography].[Geo].[America],2,BEFORE)
Returns all descendants after the given level, in our example [America] descendants at [Country] level.
Query
Descendants([Geography].[Geo].[America],[Geography].[Geo].[Country],AFTER)
Result
{
[Geography].[Geo].[City].[Quebec],
[Geography].[Geo].[City].[Toronto],
[Geography].[Geo].[City].[Mexico],
[Geography].[Geo].[City].[Los Angeles],
[Geography].[Geo].[City].[New York],
[Geography].[Geo].[City].[San Francisco],
[Geography].[Geo].[City].[Caracas]
}
Assertion : MDX Equals
Descendants([Geography].[Geo].[America],2)
Returns all descendants at the given level, in our example [America] children. It is the default flag.
Query
Descendants([Geography].[Geo].[America],[Geography].[Geo].[Country],SELF)
Result
{
[Geography].[Geo].[Country].[Canada],
[Geography].[Geo].[Country].[Mexico],
[Geography].[Geo].[Country].[United States],
[Geography].[Geo].[Country].[Venezuela]
}
Assertion : MDX Equals
Descendants([Geography].[Geo].[America],[Geography].[Geo].[Country])
Assertion : MDX Equals
[Geography].[Geo].[America].children
Returns all descendants before and after the given level; in our example [America] descendants without members at [Country] level.
Query
Descendants([Geography].[Geo].[America],[Geography].[Geo].[Country],BEFORE_AND_AFTER)
Result
{
[Geography].[Geo].[Continent].[America],
[Geography].[Geo].[City].[Quebec],
[Geography].[Geo].[City].[Toronto],
[Geography].[Geo].[City].[Mexico],
[Geography].[Geo].[City].[Los Angeles],
[Geography].[Geo].[City].[New York],
[Geography].[Geo].[City].[San Francisco],
[Geography].[Geo].[City].[Caracas]
}
Assertion : MDX Equals
{[Geography].[Geo].[America]} + Descendants([Geography].[Geo].[America],2)
Assertion : MDX Equals
Descendants([Geography].[Geo].[America]) - Descendants([Geography].[Geo].[America],1)
Returns all descendants before and at the given level; in our example [America] and his children.
Query
Descendants([Geography].[Geo].[America],[Geography].[Geo].[Country],SELF_AND_BEFORE)
Result
{
[Geography].[Geo].[Continent].[America],
[Geography].[Geo].[Country].[Canada],
[Geography].[Geo].[Country].[Mexico],
[Geography].[Geo].[Country].[United States],
[Geography].[Geo].[Country].[Venezuela]
}
Assertion : MDX Equals
{[Geography].[Geo].[America]} + {[Geography].[Geo].[America].children}
Returns all descendants at and after the given level, in our example [America] descendants (without self)
Query
Descendants([Geography].[Geo].[America],[Geography].[Geo].[Country],SELF_AND_AFTER)
Result
{
[Geography].[Geo].[Country].[Canada],
[Geography].[Geo].[City].[Quebec],
[Geography].[Geo].[City].[Toronto],
[Geography].[Geo].[Country].[Mexico],
[Geography].[Geo].[City].[Mexico],
[Geography].[Geo].[Country].[United States],
[Geography].[Geo].[City].[Los Angeles],
[Geography].[Geo].[City].[New York],
[Geography].[Geo].[City].[San Francisco],
[Geography].[Geo].[Country].[Venezuela],
[Geography].[Geo].[City].[Caracas]
}
Assertion : MDX Equals
Hierarchize( Descendants([Geography].[Geo].[America],1) + Descendants([Geography].[Geo].[America],2) )
Assertion : MDX Equals
Descendants([Geography].[Geo].[America]) - {[Geography].[Geo].[America]}
Returns all leaves between the member and the specified level; member in the specified level are considered as leaves.
Query
Descendants([Geography].[Geo].[America],[Geography].[Geo].[Country],LEAVES)
Result
{
[Geography].[Geo].[Country].[Canada],
[Geography].[Geo].[Country].[Mexico],
[Geography].[Geo].[Country].[United States],
[Geography].[Geo].[Country].[Venezuela]
}
Assertion : MDX Equals
Descendants([Geography].[Geo].[America],[Geography].[Geo].[Country],SELF)
When no level is specified, returns all leaves below the member; in this example all descendant of America in the City level.
Query
Descendants([Geography].[Geo].[America],,LEAVES)
Result
{
[Geography].[Geo].[City].[Quebec],
[Geography].[Geo].[City].[Toronto],
[Geography].[Geo].[City].[Mexico],
[Geography].[Geo].[City].[Los Angeles],
[Geography].[Geo].[City].[New York],
[Geography].[Geo].[City].[San Francisco],
[Geography].[Geo].[City].[Caracas]
}
Assertion : MDX Equals
Descendants([Geography].[Geo].[America],[Geography].[Geo].[City], SELF)
As no level or distance is specified, the default value for the level used by the function is determined by calling the Level function for the specified member.
Query
Descendants([Geography].[Geo].[Canada], , AFTER)
Result
{
[Geography].[Geo].[City].[Quebec],
[Geography].[Geo].[City].[Toronto]
}
Assertion : MDX Equals
Descendants([Geography].[Geo].[Canada], [Geography].[Geo].[Canada].level, AFTER)
As no level or distance is specified, the default value for the level used by the function is determined by calling the Level function for each member of the specified set.
Query
Descendants( { [Geography].[Geo].[Canada], [Geography].[Geo].[Europe] }, , AFTER)
Result
{
[Geography].[Geo].[City].[Quebec],
[Geography].[Geo].[City].[Toronto],
[Geography].[Geo].[Country].[France],
[Geography].[Geo].[City].[Paris],
[Geography].[Geo].[Country].[Spain],
[Geography].[Geo].[City].[Barcelona],
[Geography].[Geo].[City].[Madrid],
[Geography].[Geo].[City].[Valencia],
[Geography].[Geo].[Country].[Switzerland],
[Geography].[Geo].[City].[Geneva],
[Geography].[Geo].[City].[Lausanne],
[Geography].[Geo].[City].[Zurich]
}
Assertion : MDX Equals
Union(
Descendants( [Geography].[Geo].[Canada], [Geography].[Geo].[Canada].level, AFTER ),
Descendants( [Geography].[Geo].[Europe], [Geography].[Geo].[Europe].level, AFTER )
)