01-29-2024 05:01 PM
I'm trying to use the DataBuffer.GetFilteredDataBuffer() function which returns a DataBuffer. This function takes two parameters as follows:
1. DimTypeForFilter as DimType; If I'm filtering for accounts this is DimType.Account. DimType.UD1 for UD1, etc.
2. Now I'm having trouble with the second parameter. memberIdsInFilter As Dictionary(Of Integer, Object)
I find no examples on this. Please help with an example.
01-29-2024 05:26 PM
'Date Accounts
Dim Origination_DateAcctId As Integer = api.Members.GetMemberId(dimTypeId.Account, "Origination_Date")
'Dim AccountFilter As New Dictionary(Of Integer, Member)
'AccountFilter.Add(Origination_DateAcctId, api.Members.GetMember(DimTypeId.Account, "Origination_Date" ) )
Dim AccountFilter As New Dictionary(Of Integer, Object)
'This FILTER WORKS, but I have nothing in the Object portion of this Dictionary
AccountFilter.Add(Origination_DateAcctId, Nothing)
'Now let's get the data buffer, and be able to filter out certain accounts
Dim mystartDataBuffer As DataBuffer
mystartDataBuffer = Api.Data.GetDataBufferUsingFormula(“FilterMembers(A#All,[A#[JG Prototype].Base], U1#L10001106, U1#L10001109)”)
Dim mySpecificAccountDataBuffer As DataBuffer
mySpecificAccountDataBuffer = mystartDataBuffer.GetFilteredDataBuffer( DimType.Account, AccountFilter )
So strange. I'm able to put the dictionary keyclass (the first part) as the account's member id. That gives me the filter I want. However, what's the point of OBJECT section of the Dictionary then? I'm seeing just an array of integers in use, not a Dictionary.
ß•PK
Row# Account Flow Origin IC U1 U2 U3 U4 U5 U6 U7 U8 Amount DataType StorageType
1 Origination_Date None Forms None L10001106 None None None Existing_Book None None None "638,382,168,000,000,000.00" IsRealData Input
01-30-2024 06:02 AM
My wild guess, which i don't have time to test, is that Object can itself be a Dictionary of IDs, which will be applied to filter children of the key ID - recursively. It would be a pretty beautiful way to get subsets of a tree.
01-30-2024 09:14 AM
Oh wow. Mind blown. That would be amazing. Thanks @JackLacava.
01-30-2024 09:33 AM
I did some test but was not able to confirm this.