descendants

Returns the set of descendants of "member" or "set_expression" at "level" (qualified name) or "distance" (integer 0..n) from the root. Multiple options may be specified (separated by a space) to determine which members are returned. self: Only the members at the specified level are included in the final set (this is the default behaviour in the absence of any options). before: If there are any intermediate levels between the member's level and the one specified, members from those levels are included. If the level specified is the same as the member upon which the function is applied, the member is included in the final set. beforewithmember: If there are any intermediate levels between the member's level and the one specified, members from those levels are included. The member upon which the function is applied is also included in the final set. after: If other levels exist after the specified level, members from those levels are included in the final set. This function appears in the Sales Commissions for Central Europe sample report in the GO Data Warehouse (analysis) package.

Syntax

descendants ( member|set_expression , level|distance [ ,
 { self|before|beforewithmember|after } ] )

Example 1

descendants ( [great_outdoors_company].[Products].[Products].
[Products] , [great_outdoors_company].[Products].[Products].[Product 
type] )

Result

Returns the set of descendants of the Products set at the Product type level. Note: [great_outdoors_company].[Products].[Products].[Products] is the root member of the Products hierarchy.

Result data

Cooking Gear
Sleeping Bags
Packs
Tents
...
Eyewear
Knives
Watches

Example 2

descendants ( [great_outdoors_company].[Products].[Products].
[Products] , 1 )

Result

Returns the set of descendants of the Products set at the first level.

Result data

Camping Equipment
Golf Equipment
Mountaineering Equipment
Outdoor Protection
Personal Accessories

Example 3

descendants ( [great_outdoors_company].[Products].[Products].
[Products] , 3 , before )

Result

Returns the descendants of the Products set before the third level.

Result data

Camping Equipment
Cooking Gear
Sleeping Bags
Packs
Tents
...
Eyewear
Knives
Watches

Example 4

descendants ( [great_outdoors_company].[Products].[Products].
[Products] , 2 , self before )

Result

Returns the set of descendants of the Products set before and including the second level.

Result data

Camping Equipment
Cooking Gear
Sleeping Bags
Packs
Tents
...
Eyewear
Knives
Watches