EnumAllParentAndChildLabels

Returns arrays that contain member labels and that represent the parent-child relationships of a dimension’s members. The arrays are returned in the method’s arguments; the first argument returns the parent labels and the second argument returns the child labels.

The elements in the two arrays have a one-to-one correspondence. For example, the member identified by the parent array’s first element is the parent of the member identified by the child array’s first element.

Syntax

<IHsvTreeInfo>.EnumAllParentAndChildLabels pvarabstrParents, pvarabstrChildren

Argument

Description

pvarabstrParents

Variant array. Returns the labels of the parent members. The array is returned as a String subtype.

pvarabstrChildren

Variant array. Returns the labels of the child members. The array is returned as a String subtype.

Note:

System-generated members are included in the return value.

Understanding the Arguments’ Parent-Child Arrays

To understand how the two arrays relate to each other, consider the HIERARCHIES sections of metadata load files, which are documented in the Oracle Hyperion Financial Management, Fusion Edition Administrator's Guide. HIERARCHIES sections consist of comma-delimited records, where the first field contains the parent member’s label and the second field contains the child member’s label. Consider the following example of a HIERARCHIES section:

  !HIERARCHIES=Entity
  ,[None]
  ,Regional
  Regional,UnitedStates
  UnitedStates,California
  California,Sunnyvale
  California,FosterCity

This HIERARCHIES section lists six parent-child combinations for the Entity dimension. The following table enumerates the elements of the arrays that EnumAllParentAndChildLabels would return for this set of entities:

Index #

Parent array element

Child array element

0

 

[None]

1

 

Regional

2

Regional

UnitedStates

3

UnitedStates

California

4

California

Sunnyvale

5

California

FosterCity

When an entity has no child, the corresponding parent array element will be an empty string; this is why the table shows no parent array element for the [None] and Regional entities.

Example

The following example displays the names of the parent entities for the entity specified in a combo box control. The example sets an IHsvTreeInfo object reference for the Entity dimension, then calls EnumAllParentAndChildLabels to populate the vaParents and vaChildren variables with arrays. The example then loops through the vaChildren array; when an array element contains the name of the entity specified in the comboEnts combo box, the entity’s parent is concatenated to the sParents variable.

Dim cIHsvTreeInfo As IHsvTreeInfo, sParents As String
Dim vaParents, vaChildren
Set cIHsvTreeInfo = m_cMetadata.Dimension(DIMENSIONENTITY)
cIHsvTreeInfo.EnumAllParentAndChildLabels vaParents, vaChildren
For i = LBound(vaChildren) To UBound(vaChildren)
  If vaChildren(i) = comboEnts.Text Then
    sParents = sParents & vbCrLf & vaParents(i)
  End If
Next i
MsgBox comboEnts.Text & " parents: " & sParents