Data Management & Data Buffer on 2 entities
Hi !
I want to confirm a data management behaviour...
Right now I have data in a driver on Entity 9999, that I need in order to calculate data on entity 1032. The output should be on entity 1032.
I am using a data management job where the DUCS are set for Entity 1032. However when I run the DM, my data buffer is not getting any data for Entity 9999.
I think somewhere someone mentioned that using SetDataBufferVariable you can retain data in the whole Data Management sequence, so I tried to change the Data Management DUCS to "E#9999, E#1032". But the variable seem to be cleared when cycling to the second entity.
Then my question is : How can I get my data buffer to "read" data from another entity (E#9999) when my data management job run on E#1032 ?
Here's my code which obviously doesn't work at the moment. The goal is simply to have databuffer1 get data from Entity 9999, and databuffer2 to get data from current entity 1032:
Dim dbr1 As DataBuffer = Nothing
If api.Pov.Entity.Name = "9999"
dbr1 = api.Data.GetDataBufferUsingFormula("V#Periodic:A#OVH_ALLOC_KEYS:O#Forms",dataapiscriptmethodtype.Calculate)
api.Data.FormulaVariables.SetDataBufferVariable("myDataBuffer1", dbr1,False)
dbr1.LogDataBuffer(api, "ovh_dbr1 " & api.Pov.Entity.Name ,100)
Else
dbr1 = api.Data.GetDataBufferUsingFormula("$mydatabuffer1")
End If
Dim dbr2 As DataBuffer = Nothing
If api.Pov.Entity.Name <> "9999"
dbr2 = api.Data.getdatabufferusingformula("FilterMembers(removezeros(V#YTD:A#DIST_DIR:O#BeforeAdj:I#None:U1#None:U3#US:U4#None:U5#BU_USA:U7#HO:U8#None),F#Import_by_Currency.Base)")
api.Data.FormulaVariables.SetDataBufferVariable("myDataBuffer2", dbr2, False)
dbr2.LogDataBuffer(api, "ovh_dbr2",100)
End If
Regards,
