Export Data (Including Dynamic Calcs) using a DataBuffer

Keyser_Soze
New Contributor III

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 ?

 

1 ACCEPTED SOLUTION

JackLacava
Community Manager
Community Manager

There is no need for parentheses inside FilterMembers, just list all the filters you want to apply. I may be wrong, but I think you should be able to have multiple filters for the same dimension and they will act as OR, in the same way as in Calculate filters.

As for exporting dynamic data, I would recommed using FdxExecuteCubeView instead.

View solution in original post

4 REPLIES 4

JackLacava
Community Manager
Community Manager

There is no need for parentheses inside FilterMembers, just list all the filters you want to apply. I may be wrong, but I think you should be able to have multiple filters for the same dimension and they will act as OR, in the same way as in Calculate filters.

As for exporting dynamic data, I would recommed using FdxExecuteCubeView instead.

The CubeView method is awesome, thanks a bunch !
Would you recommend separating data (Non dynamic/Dynamic) using FdxDataUnit & FdxCubeView then joining tables later on ? or we can insert everything in the CView ? (time-wise)

The cube view will pull your ALL your data.

Why do you want to split it out and then try to merge it back together?  That seems like you would create more potential for data issues/risk. 

Fdx calls are already heavily parallelized, so you won't gain anything (from a performance perspective) from splitting them. It might make sense from an organizational/maintenance perspective, depending on your requirements (i.e. sometimes, stuffing everything in a single CV is just hard from a design perspective).