Forum Discussion
chris_rothermel
OneStream Employee
2 years agomemberIdsInFilter As Dictionary(Of Integer, Object)
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.
4 Replies
- chris_rothermel
OneStream Employee
'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- JackLacava
OneStream Employee
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.
- chris_rothermel
OneStream Employee
Oh wow. Mind blown. That would be amazing. Thanks JackLacava.
- chris_rothermel
OneStream Employee
I did some test but was not able to confirm this.