Krishna
2 years agoValued Contributor
Finance Rule for sorting members with Parameters in the cube view
The below finance rule will sort the members in my case it is entity and it will take the parameters in the Cube view.
'*******************************************************************************************************************
'Parameters in the Cube View
'E#Root.CustomMemberList(BRName=MemberSort, MemberListName=AscEntSort, Memlist=E#[Legal].DescendantsInclusive)
'********************************************************************************************************************
Dim Memberlistname As String = "AscEntSort"
Dim MemberListstart As String = args.MemberListArgs.NameValuePairs.XFGetValue("Memlist",Nothing)
Case Is = FinanceFunctionType.MemberList
If args.MemberListArgs.MemberListName = Memberlistname Then
Dim objMemberListHeader = New MemberListHeader(args.MemberListArgs.MemberListName)
'members into the list
Dim objMemberInfos As List(Of MemberInfo) = api.Members.GetMembersUsingFilter( _
args.MemberListArgs.DimPk, MemberListstart, Nothing)
'Sort the members with Ascending Order
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).ToList()
End If
'Return
Return New MemberList(objMemberListHeader, objMembers)
End If
Hey Kris,
thanks for posting your spin on the XFR_MemberListAlphabetical rule from Golfstream. You have successfully parameterized the list that is passed in; I guess the next step would be to parameterize the sorting order 😉