Returns the index of a period within a subcube, given the subcube’s index and the period’s member ID. An index is returned only for periods with cells that contain data.
<HsvMDDataBufferLite>.GetPeriodIndexFromPOVForData lCubeIndex, lPeriod, plPeriodIndex
The following example gets a subcube’s index, the index of a period in the subcube, and the number of cells in the period that contain data, then prints the cells’ data to Visual Basic’s Immediate window. The example assumes that the member IDs of the subcube and period have been previously defined. GetCubeIndexFromPOV returns the index of the subcube. GetPeriodIndexFromPOVForData then gets the period’s index. GetNumCellsForData takes the subcube and period indexes and returns the number of cells that contain data. For each cell, GetDataAtIndex returns the cell’s data, which is then printed to the Immediate window.
Dim lCubeIx As Long, lPerIx As Long, lNumCells As Long Dim lNumCubes As Long, dCellData As Double, bIsNoData As Boolean Dim lView As Long, lAcct As Long, lICP As Long, lCust1 As Long Dim lCust2 As Long, lCust3 As Long, lCust4 As Long m_cMDBufferLite.BeginEnumeration lNumCubes m_cMDBufferLite.GetCubeIndexFromPOV m_lScen, m_lYear, m_lEnt, _ m_lPar, m_lVal, lCubeIx ' Exit if there are no subcubes If lCubeIx = -1 Then m_cMDBufferLite.EndEnumeration Exit Sub Else m_cMDBufferLite.GetPeriodIndexFromPOVForData lCubeIx, _ m_lPer, lPerIx ' Exit if the period does not have cells with data If lPerIx = -1 Then m_cMDBufferLite.EndEnumeration Exit Sub Else m_cMDBufferLite.GetNumCellsForData lCubeIx, _ lPerIx, lNumCells For i = 0 To lNumCells - 1 m_cMDBufferLite.GetDataAtIndex lCubeIx, lPerIx, i, _ lView, lAcct, lICP, lCust1, lCust2, lCust3, _ lCust4, dCellData, bIsNoData Debug.Print dCellData Next i End If End If m_cMDBufferLite.EndEnumeration