Rianne
2 years agoNew Contributor II
CubeView Member Expansion based on 'AllowInput=True'
Hi Team,
I am trying to create an Input CubeView with an expansion based on whether the 'Allow Input' setting is set to True for our UD5 Dimension Members.
To give a little bit of background, we...
- 2 years ago
Hi Rianne
You can create a custom member list to do this for you. The code below should do the trick.
Create a Finance Business Rule (this one is called 'MY_CustomMemberList' and the member list is called 'Customers' you can rename these to what ever you like)
Imports System Imports System.Collections.Generic Imports System.Data Imports System.Data.Common Imports System.Globalization Imports System.IO Imports System.Linq Imports System.Windows.Forms Imports Microsoft.VisualBasic Imports OneStream.Finance.Database Imports OneStream.Finance.Engine Imports OneStream.Shared.Common Imports OneStream.Shared.Database Imports OneStream.Shared.Engine Imports OneStream.Shared.Wcf Imports OneStream.Stage.Database Imports OneStream.Stage.Engine Namespace OneStream.BusinessRule.Finance.MY_CustomMemberList Public Class MainClass Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As FinanceRulesApi, ByVal args As FinanceRulesArgs) As Object Try Select Case api.FunctionType Case Is = FinanceFunctionType.MemberListHeaders Dim objMemberListHeaders As New List(Of MemberListHeader) objMemberListHeaders.Add(New MemberListHeader("Customers")) Return objMemberListHeaders Case Is = FinanceFunctionType.MemberList If args.MemberListArgs.MemberListName.XFEqualsIgnoreCase("Customers") Then 'Example: U5#Root.CustomMemberList(BRName=MY_CustomMemberList, MemberListName=[Customers]) 'Prepare Member List Header & List of Member Infos Dim memberListHeader As New MemberListHeader(args.MemberListArgs.MemberListName) Dim memberList As New List(Of Member) Dim d As [Dim] = api.Dimensions.GetDim("Customers") Dim UD5BaseMembers As List(Of MemberInfo) = api.Members.GetMembersUsingFilter(d.DimPk, "U5#Customers.Base") 'Loop through each member and only add if AllowInput = True For Each m As MemberInfo In UD5BaseMembers If api.UD5.AllowInput(m.Member.MemberId) Then memberList.Add(m.Member) End If Next 'Return Member List Return New MemberList(memberListHeader, memberList) 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
Call the custom member list in your cube view using the following:
U5#Root.CustomMemberList(BRName=MY_CustomMemberList, MemberListName=[Customers])
Regards,
Mark