GetPeriodsInFrequency

Returns an array containing the member IDs of a given frequency’s Period dimension members.

Syntax

<HFMwPeriods>.GetPeriodsInFrequency varlFrequencyID, varlFlagsRequestedInfo, pVal

Argument

Description

varlFrequencyID

The ID of the frequency.

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.

varlFlagsRequestedInfo

Future use. You must specify a value for this argument, but the value currently has no effect.

Input argument.

pVal

Returns an array containing the member IDs of the frequency’s Period dimension members.

Input/output argument.

Example

The following function takes a Scenario dimension member’s label and returns the labels of the Period dimension members for the scenario’s default frequency. The example gets the scenario’s default frequency with HFMwScenarios.defaultFrequency.

Function GetScenDefFreq(sScen)
Dim cHFMMetadata, cHFMScen, cHFMPer, cHFMDim
Dim lId, laPers, saPers()
' cHFMSession is a previously set HFMwSession object
Set cHFMMetadata = cHFMSession.metadata
Set cHFMScen = cHFMMetadata.scenarios
Set cHFMPer = cHFMMetadata.periods
Set cHFMDim = cHFMPer.dimension
lId = cHFMScen.defaultFrequency(sScen)
cHFMPer.GetPeriodsInFrequency lId, 0, laPers
ReDim saPers(uBound(laPers))
For i = lBound(laPers) to uBound(laPers)
   saPers(i) = cHFMDim.GetMemberLabel(laPers(i))
Next
GetScenDefFreq = saPers
End Function