SetData

Inserts a cell’s data into an HsvMDDataBuffer object.

Syntax

<HsvMDDataBuffer>.SetData lScenario, lYear, lPeriod, lView, lEntity, lParent, lValue, lAccount, lICP, lCustom1, lCustom2, lCustom3, lCustom4, dData, vbIsNoData, vbAddToExistingData, plNumElementsInDataUnit

Argument

Description

lScenario

Long (ByVal). The member ID of the cell’s Scenario dimension member.

lYear

Long (ByVal). The member ID of the cell’s Year dimension member.

lPeriod

Long (ByVal). The member ID of the cell’s Period dimension member.

lView

Long (ByVal). The member ID of the cell’s View dimension member. You must pass a member ID for a user-defined member. Do not pass the member ID for the system-defined member <Scenario View>.

lEntity

Long (ByVal). The member ID of the cell’s Entity dimension member.

lParent

Long (ByVal). Pass the HFMConstants type library constant MEMBERNOTUSED.

lValue

Long (ByVal). The member ID of the cell’s Value dimension member. You must pass a member ID for a user-defined member. Do not pass a member ID for system-defined members such as <Entity Currency>.

lAccount

Long (ByVal). The member ID of the cell’s Account dimension member.

lICP

Long (ByVal). The member ID of the cell’s Intercompany Partner dimension member.

lCustom1

Long (ByVal). The member ID of the cell’s Custom 1 dimension member.

lCustom2

Long (ByVal). The member ID of the cell’s Custom 2 dimension member.

lCustom3

Long (ByVal). The member ID of the cell’s Custom 3 dimension member.

lCustom4

Long (ByVal). The member ID of the cell’s Custom 4 dimension member.

dData

Double (ByVal). The cell’s data.

vbIsNoData

Boolean (ByVal). Determines whether the cell is set to null. Pass TRUE to set to null, FALSE otherwise.

vbAddToExistingData

Boolean (ByVal). If the HsvMDDataBuffer object already contains data for the cell, this argument determines whether the existing data will be overwritten. Pass TRUE to add the dData argument’s data to the existing data, FALSE to overwrite the existing data.

plNumElementsInDataUnit

Long. Returns the number of cells in the HsvMDDataBuffer object that are in the subcube to which the cell belongs. This number returned is calculated after SetData adds the cell.

Example

The following function inserts data into cells that differ by account but otherwise share the same dimension members.

Function setDataforAccts(lScen As Long, lYear As Long, lPer As _
    Long, lView As Long, lEnt As Long, lVal As Long, _
    laAccts() As Long, lIcp As Long, lCust1 As Long, lCust2 As Long, _
    lCust3 As Long, lCust4 As Long, daData() As Double, saDescs() As _
    String) As Long
Dim cMDBuffer As HsvMDDataBuffer, lNumElems As Long, cData As HsvData
Set cMDBuffer = New HSVMDARRAYSLib.HsvMDDataBuffer
'g_cSession is an HsvSession object reference
Set cData = g_cSession.Data
For i = LBound(laAccts) To UBound(laAccts)
cMDBuffer.SetData lScen, lYear, lPer, lView, lEnt, MEMBERNOTUSED, lVal, _
   laAccts(i), lIcp, lCust1, lCust2, lCust3, lCust4, daData(i), _
   False, False, lNumElems
Next i
cData.UpdateDataUsingMDDataBuffer cMDBuffer, HSV_DATA_UPDATE_ACCUMULATE, _
    False
setDataforAccts = lNumElems
End Function