SortMembersBasedOnList

Filters and sorts member IDs, using the members in a member list as the filtering and sorting criteria. Given an array of member IDs and an ID of a member list, SortMembersBasedOnList filters out the IDs of those members that are not in the member list, then sorts the remaining IDs according to the order in which the members are defined in the list.

Tip:

You can also filter and sort against a dimension’s default hierarchy instead of a member list.

Syntax

<IHsvTreeInfo>.SortMembersBasedOnList lListID, lListTopMemberID, bIgnoreDuplicates, varalInputItemIDs, varalInputParentIDs, pvaralItemIDs, pvaralParentIDs

Argument

Description

lListID

Long (ByVal). Identifies whether a member list or the default dimension hierarchy will be used to filter and sort. Pass a valid list ID to use a member list, or pass the HFMConstants type library constant MEMBER_LIST_ALL_HIERARCHY to use the default hierarchy.

Tip:

You can get member list IDs with GetMemberListID. For more information, see GetMemberListID.

lListTopMemberID

Long (ByVal). The usage of this argument depends on what you pass to the lListID argument:

  • If you pass MEMBER_LIST_ALL_HIERARCHY to lListID, this determines whether you sort and filter by using all of the dimension’s members or by the members of a node. Pass the TREE_ROOT constant to use all members, or the member ID of the node’s parent to use a node.

  • If you pass anything other than MEMBER_LIST_ALL_HIERARCHY to lListID, the lListTopMemberID argument is ignored. Note that since this argument is not optional, you must still pass a valid Long.

bIgnoreDuplicates

Boolean (ByVal). Specifies whether duplicate member IDs are returned. Pass TRUE to filter out duplicates, FALSE to return duplicates.

varalInputItemIDs

Long array (ByVal). The member IDs to be sorted and filtered.

varalInputParentIDs

Long array (ByVal). The member IDs of the parent members passed in the varalInputItemIDs argument. The items in these two arrays must have a one-to-one correspondence.

pvaralItemIDs

Variant array. Returns the filtered and sorted member IDs. The array is returned as a Long subtype.

pvaralParentIDs

Variant array. Returns the IDs of the parents of the members returned in the pvaralItemIDs argument. The array is returned as a Long subtype.