GetDescendantsAtFrequency

Returns an array containing the labels of given Period dimension member’s descendants at the specified frequency of the application’s frequency hierarchy.

Syntax

<HFMwPeriods>.GetDescendantsAtFrequency (bstrPeriod, lFreq)

Argument

Description

bstrPeriod

The label of the Period dimension member. The specified period must be at a higher level in the frequency hierarchy than the frequency specified in the lFreq argument.

Input argument. String subtype.

lFreq

The internal ID of the frequency that contains the descendants to be returned.

Tip:

You can get internal ID of a period’s frequency with GetFrequency, and the internal ID of a scenario’s default frequency with HFMwScenarios.defaultFrequency.

Input argument. Long subtype.

Return Value

Returns an array containing the labels of the descendants.

Example

The following function returns the labels of a given period’s descendant periods at the default frequency of a given scenario. If the specified period is not at a higher level in the frequency hierarchy than the scenario’s default frequency, an empty string is returned.

Function getDescendantsDefScenFreq(sPeriod, sScenario)
Dim cHFMMetadata, cHFMPeriods, cHFMScenarios
Dim lFrequency, sRet, lDefaultFreq
Set cHFMMetadata = cHFMSession.metadata
Set cHFMPeriods = cHFMMetadata.periods
Set cHFMScenarios = cHFMMetadata.scenarios
lDefaultFreq = cHFMScenarios.defaultFrequency(sScenario)
lFrequency = cHFMPeriods.GetFrequency(sPeriod)
If lDefaultFreq > lFrequency Then
   sRet = cHFMPeriods.GetDescendantsAtFrequency(sPeriod, _
      lDefaultFreq)
Else
   sRet = ""
End If 
getDescendantsDefScenFreq = sRet
End Function