Keyser_Soze
2 years agoContributor
Export Data (Including Dynamic Calcs) using a DataBuffer
I am trying to export Data including dynamically calculated accounts using a DataBuffer (Not just base members but all intermediate levels).
I can do this by looping over Accounts+U1+U2 combined with GetDataCell()... but it is unbearably long and inefficient
I am wondering if we can use a data buffer this way ? If not what would the best method be ?
Dim MFEntity As String = "E#TopEntity.TreeDescendants.Where(Text1 Contains 'myValue')"
Dim lstofEntities As List(Of MemberInfo) = BRApi.Finance.Metadata.GetMembersUsingFilter(si, "Entity_Dimension", MFEntity, True)
Dim MFAccounts As String = "A#Root.Base.Where(AccountType = 'DynamicCalc')"
Dim lstofAccounts As List(Of MemberInfo) = BRApi.Finance.Metadata.GetMembersUsingFilter(si, "Account_Dimension", MFAccounts, True)
Dim lstofAccountsStr As String = String.Join(", ", lstofAccounts.Select(Function(x) "A#" & x.Member.Name).ToList())
For Each myEntity In lstofEntities
Dim mfDataBuffer As String = "FilterMembers(E#" & myEntity.Member.Name & ":T#" & myTime & ":S#" & myScenario & ":C#Local , (V#YTD, V#Periodic), (" & lstofAccountsStr & ") )"
Dim tpDataBuffer As DataBuffer = api.Data.GetDataBufferUsingFormula(mfDataBuffer,, False)
Next myEntity
I get an error when generating a databuffer saying the filter for the Accounts is expecting a right parenthesis after first member. Is the syntax 'FilterMembers(.... , (A#Acc1, A#Acc2, A#Acc3)) not accepted ?