GetNumParents

Returns the number of parents for a dimension member, given the member’s ID.

Syntax

<IHsvTreeInfo>.GetNumParents lMemberID, plNum

Argument

Description

lMemberID

Long (ByVal). The ID of the dimension member.

plNum

Long. Returns the number of parents for the member.

Example

This example creates a function that takes an Entity dimension member’s label and returns a count of the member’s parents. GetItemID gets the member’s ID, which is passed to GetNumParents. The count of members returned by GetNumParents is assigned as the function’s return value.

Function getEntityParentCount(sChildLabel As String) As Long
Dim cTreeInfo As IHsvTreeInfo, lChildID As Long
Dim lNumParents As Long
Set cTreeInfo = m_cMetadata.Entities
lChildID = cTreeInfo.GetItemID(sChildLabel)
cTreeInfo.GetNumParents lChildID, lNumParents
getEntityParentCount = lNumParents
End Function