Forum Discussion
ChristianW
2 years agoValued Contributor
I assume you like to do it in a dynamic list for cubeviews. This code works:
If args.MemberListArgs.MemberListName.XFEqualsIgnoreCase("Sorted") Then
Dim yourScript As String = args.MemberListArgs.NameValuePairs("Script")
Dim yourDimTypeName As String = args.MemberListArgs.NameValuePairs("DimType")
Dim yourParent As String = args.MemberListArgs.NameValuePairs("Parent")
Dim yourDimTyp As DimType = DimType.GetItem(yourDimTypeName)
Dim dataBufferOfScript As DataBuffer = api.Data.GetDataBufferUsingFormula($"FilterMembers({yourScript}, {yourDimTyp.Abbrev}#{yourParent}.base)")
Dim listOfDataBufferCells As List(Of DataBufferCell) = dataBufferOfScript.DataBufferCells.Values.ToList()
' listOfDataBufferCells = listOfDataBufferCells.OrderByDescending(Function(x) x.CellAmount).ToList()
listOfDataBufferCells = listOfDataBufferCells.OrderBy(Function(x) x.CellAmount).ToList()
Dim listOfUd1 As List(Of MemberInfo) = listOfDataBufferCells.Select(Function(x) New MemberInfo(api.Members.GetMember(DimTypeId.UD1, x.DataBufferCellPk.UD1Id))).ToList()
Dim objMemberListHeader As New MemberListHeader(args.MemberListArgs.MemberListName)
Dim objMemberList As New MemberList(objMemberListHeader, listOfUd1)
Return objMemberList
End If
in a cubeview you call it like this:
UD1#Root.CustomMemberList(BRName=CustomLists, MemberListName=Sorted, script=[E#NAE:C#Local:S#Actual:T#2023M6:V#Periodic:A#99999:F#EndBalLoad:O#Top:I#Top:U2#REGTop:U3#PRDTop:U4#CSTTop:U5#None:U6#None:U7#UD7Top:U8#None],DimType=Ud1, Parent=CCTop)
Related Content
- 2 years ago
- 2 years ago
- 5 months ago