FindMemberOccurrencesInHierarchyEx

Returns an array containing the fully qualified names of all members whose names match the specified search string and that are descendants of the specified member.

Tip:

To return the names of all members in a dimension that match a search string, use FindMemberOccurrencesInHierarchy.

Syntax

<HFMwDimension>.FindMemberOccurrencesInHierarchyEx (bstrSearchText, varTopMember)

Argument

Description

bstrSearchText

The search string. Specify either a member name or a string containing a wildcard to search for a partial match. For example, "C*" searches for any member that begins with the letter C.

Input argument. String subtype.

varTopMember

The ancestor of the descendants to be searched. Identify this member by passing one of the following items:

  • A string containing the member’s label

  • A long containing the member’s ID

Input argument.

Return Value

Returns an array containing the fully qualified names of the members that match the search criteria; the path lists all members beneath the member specified in the varTopMember argument. In the array items, the member names in the hierarchy are delimited by backslashes. For example, if you search for all entities that begin with the letter “C”, FindMemberOccurrencesInHierarchyEx would return array items similar to the following, and varTopMember would be the parent of the UnitedStates and Canada entities:

Example

The following function returns the names of all Entity dimension members that match the passed search string and that are descendants of the passed member.

Function getEntitiesUnderAncestor(sList, sTopMem)
Dim cHFMMetadata, cHFMEntities, cDimension, sarEntity
set cHFMMetadata = Server.CreateObject("Hyperion.HFMwMetadata")
cHFMMetadata.SetWebSession cHFMSession
Set cHFMEntities = cHFMMetadata.entities
Set cDimension = cHFMEntities.dimension
sarEntity = cDimension.FindMemberOccurrencesInHierarchyEx _ 
(sList, sTopMem)
getEntitiesUnderAncestor = sarEntity
End Function