Returns an array containing the member IDs of the dimension members in either the default dimension hierarchy, a static member list, or a dynamic member list for given Scenario, Year, Period, and Entity dimension members. The value passed to the lListID argument determines whether the returned IDs are from the default hierarchy or from a member list.
For the Entity dimension, EnumMembers2 returns child entity member IDs in the pvaralItemIDs argument and the corresponding parent member IDs in the pvaralParentIDs argument. For the other dimensions, EnumMembers2 returns members in the pvaralItemIDs argument, and the pvaralParentIDs argument is left uninitialized.
You can also return members from the default dimension hierarchy or from a static member list with EnumMembers, which does not take member IDs of Scenario, Year, and Period dimension members. |
<IHsvTreeInfo>.EnumMembers2 lListID, lListTopMemberID, lScenario, lYear, lPeriod, lEntity, pvaralItemIDs, pvaralParentIDs
Long (ByVal). Identifies either a member list or the default dimension hierarchy. Pass a valid list ID to return the members in a member list, or the HFMConstants type library constant MEMBER_LIST_ALL_HIERARCHY to return the members in the default hierarchy. You can get member list IDs with GetMemberListID. | |
Long (ByVal). The usage of this argument depends on what you pass to the lListID argument:
| |
Long (ByVal). The member ID of the Scenario dimension member for a dynamic member list. | |
Long (ByVal). The member ID of the Year dimension member for a dynamic member list. | |
Long (ByVal). The member ID of the Period dimension member for a dynamic member list. | |
Long (ByVal). The member ID of the Entity dimension member for a dynamic member list. | |
Variant array. For the Entity dimension, this argument returns the member IDs of the child entities. For the other dimensions, this argument returns the member IDs of the dimension members. | |
Variant array. For the Entity dimension, this argument returns the member IDs of the parents of the members returned in the pvaralItemIDs argument. The array is returned as a Long subtype. |
The following function returns an array containing the members in an Entity dimension dynamic member list for a given scenario, year, and period. In the array, the parent and child entities are delimited by periods.
Function getDynamicList(lScen As Long, lYear As Long, _ lPer As Long) As Variant Dim cIHsvTreeInfo As IHsvTreeInfo, lListID As Long Dim vaChildIDs, vaParIDs, vaRet() Dim sLabel As String, sParLabel As String 'm_cHsvMetadata is an HsvMetadata object Set cIHsvTreeInfo = g_cMetadata.Entities cIHsvTreeInfo.GetMemberListID "Dynamic", lListID cIHsvTreeInfo.EnumMembers2 lListID, -1, lScen, lYear, lPer, _ MEMBERNOTUSED, vaChildIDs, vaParIDs ReDim vaRet(UBound(vaChildIDs)) For i = LBound(vaChildIDs) To UBound(vaChildIDs) cIHsvTreeInfo.GetLabel CLng(vaParIDs(i)), sParLabel cIHsvTreeInfo.GetLabel CLng(vaChildIDs(i)), sLabel vaRet(i) = sParLabel & "." & sLabel Next i getDynamicList = vaRet End Function