The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
CLU
1 year agoNew Contributor III
Numerical Order: Cube View Accounts (MFB)
Hello,
Is there a way to sort accounts in numerical order using the member filter builder?
Need to see trial balance in numerical order based on account name (i.e. A#12345, A#98765, etc) using the hierarchy. It would help as well if we could apply alphabetical sorting as well for the accounts which start with names. (i.e. Investment Other, Autos, etc).
Thank you in advance,
1 Reply
- T_Kress
OneStream Employee
Yes, the GolfStream app has an example Finance BR that does a member list and sorts a dimension alphabetically.
Here is a tiny code example of that that would look like, but please refer to GolfStream for a more complete example.Then you use this member list in your cube view.
Namespace OneStream.BusinessRule.Finance.XFR_MemberListAlphabetical Public Class MainClass '------------------------------------------------------------------------------------------------------------ 'Reference Code: XFR_MemberListAlphabetical ' 'Description: Use a business rule to sort a member list in Alphabetical order ' 'Usage: This will put a member list of a dimension in Alphabetical order. ' Use the following on the cube view E#Member.[Name of Business Rule, Name of List in Business Rule] ' E#Root.[XFR_MemberListAlphabetical, EntityAlphabetical] ' '------------------------------------------------------------------------------------------------------------ Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As FinanceRulesApi, ByVal args As FinanceRulesArgs) As Object Try 'This will put a member list of a dimension in Alphabetical order. 'Use the following on the cube view A#Member.[Name of Business Rule, Name of List in Business Rule] 'A#Root.[XFR_MemberListAlphabetical, Acct_Sort] ' Dim Memberlistname As String = "Acct_Sort" ' Dim Memberlistname As String = "Ent_Sort" Dim wfProfileName As String = api.Workflow.GetWorkflowUnitInfo.ProfileName Dim wfProfileCubeName As String = BRApi.Workflow.Metadata.GetProfile(si, wfProfileName).CubeName Dim CurCube As String = api.Pov.Cube.Name Select Case api.FunctionType Case Is = FinanceFunctionType.MemberList If args.MemberListArgs.MemberListName = "ISBSXAcct_Sort" Then Dim objMemberListHeader = New MemberListHeader(args.MemberListArgs.MemberListName) Dim MemberListstart As String = "A#IS_BS.base.Options(Cube = " & CurCube & ",ScenarioType= Actual, MergeMembersFromReferencedCubes=False).Where(Text2 DoesNotContain 'Historical')" ' brapi.ErrorLog.LogMessage (si,"Cube Name: " & CurCube) 'Read the members Dim objMemberInfos As List(Of MemberInfo) = api.Members.GetMembersUsingFilter(args.MemberListArgs.DimPk, MemberListstart, Nothing) 'Sort the members Dim objMembers As List(Of Member) = Nothing If Not objMemberInfos Is Nothing Then objMembers = (From memberInfo In objMemberInfos Order By memberInfo.Member.Name Ascending Select memberInfo.Member Distinct).ToList() End If 'Return Return New MemberList(objMemberListHeader, objMembers) End If End Select Return Nothing Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Function End Class End Namespace
Related Content
- 3 years ago