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]}