GetNumDescendants

Returns the number of descendants beneath a member in a dimension’s hierarchy, given the member’s ID.

Syntax

<IHsvTreeInfo>.GetNumDescendants lParentID, plNum

Argument

Description

lParentID

Long (ByVal). The member’s ID.

plNum

Long. Returns the number of descendants beneath the dimension member.

Example

This example creates a function that takes a Scenario dimension member’s label and returns a count of the member’s descendants. The label is passed to GetItemID, which returns the member’s ID. This ID is passed to GetNumDescendants, which returns the number of descendants that is assigned as the function’s return value.

Function getEntDescendants(sParLabel) As Long
Dim cTreeInfo As IHsvTreeInfo, lParID As Long, lNumDesc As Long
Set cTreeInfo = m_cMetadata.Entities
lParID = cTreeInfo.GetItemID(sParLabel)
cTreeInfo.GetNumDescendants lParID, lNumDesc
getEntDescendants = lNumDesc
End Function