The following example extracts data for the following dimension members:
The example uses a user-defined function named GetMemberID to obtain the IDs of these members. For information on this user-defined function, see the Examples for GetItemID. |
Dim cHsvcDataLoad As HsvcDataLoad, cOptions As IHsvLoadExtractOptions Dim cOpt As IHsvLoadExtractOption, lScen As Long, lYear As Long Dim lPer(2) As Long, lAcct(0) As Long, lPar(0) As Long, lEnt(0) As Long Set cHsvcDataLoad = New HsvcDataLoad 'Specify the HsvSession object for the application. cHsvcDataLoad.SetSession g_cHsvSession 'Initialize the IHsvLoadExtractOptions interface. Set cOptions = cHsvcDataLoad.ExtractOptions 'Set the scenario Set cOpt = cOptions.Item(HSV_DATAEXTRACT_OPT_SCENARIO_SUBSET) lScen = GetMemberID(DIMENSIONSCENARIO, "Actual") cOpt.CurrentValue = lScen 'Set the year Set cOpt = cOptions.Item(HSV_DATAEXTRACT_OPT_YEAR_SUBSET) lYear = GetMemberID(DIMENSIONYEAR, "2000") cOpt.CurrentValue = lYear 'Set the periods Set cOpt = cOptions.Item(HSV_DATAEXTRACT_OPT_PERIOD_SUBSET) lPer(0) = GetMemberID(DIMENSIONPERIOD, "July") lPer(1) = GetMemberID(DIMENSIONPERIOD, "August") lPer(2) = GetMemberID(DIMENSIONPERIOD, "September") cOpt.CurrentValue = lPer 'Set the account Set cOpt = cOptions.Item(HSV_DATAEXTRACT_OPT_ACCOUNT_SUBSET) lAcct(0) = GetMemberID(DIMENSIONACCOUNT, "Sales") cOpt.CurrentValue = lAcct 'set the entities Set cOpt = cOptions.Item(HSV_DATAEXTRACT_OPT_PARENT_SUBSET) lPar(0) = GetMemberID(DIMENSIONENTITY, "UnitedStates") cOpt.CurrentValue = lPar Set cOpt = cOptions.Item(HSV_DATAEXTRACT_OPT_ENTITY_SUBSET) lEnt(0) = GetMemberID(DIMENSIONENTITY, "NewYork") cOpt.CurrentValue = lEnt 'Extract the data cHsvcDataLoad.Extract "c:\Acme\myApp.dat", "c:\Acme\myApp.log"