Forum Discussion

carbon's avatar
carbon
New Contributor
8 hours ago

Business Rule to Remove Base-Level Entities from a Parent Rollup Based on Keyword Match

Hi everyone,

I'm working on a Business Rule in OneStream and could use some guidance.

I’m trying to build a rule that targets a user-defined parent rollup within the Entity Dimension. The goal is to automatically remove the relationship between that rollup and any base-level child entities whose name or description contains a specific keyword — in this case, "YS".

Here’s what I’m aiming for:

  • The rule should accept a parent rollup name (e.g., Global_excl_YS)
  • It should loop through all children of that rollup
  • If a child is a base member and its name or description includes "YS", the rule should "remove the relationship"
  • Parent or intermediate rollups should remain untouched

I’m planning to implement this as an Extensibility Business Rule, but I’d love to hear if anyone has done something similar or has tips on best practices for metadata manipulation in this context.

Thanks in advance!



' Define dimension and parent rollup as parameters or hardcode here
                Dim EntityDimPK As DimPk = BRApi.Finance.Dim.GetDimPk(si, "MgmtEntity")
                Dim RollupName As String = "Global_excl_YS"
                Dim RollupMember As Member = BRApi.Finance.Members.GetMember(si, dimtype.Entity.Id, RollupName)
 
                ' Get all direct children of the rollup
                Dim Children As List(Of Member) = BRApi.Finance.Members.GetChildren(si, EntityDimPK, RollupMember.MemberId, Nothing)
 
                Dim RemovedEntities As New List(Of String)
                For Each ChildMember As Member In Children
                    Dim ChildName As String = ChildMember.Name
                    Dim ChildDesc As String = If(ChildMember.Description, "")
                    ' Check if base (no children)
                    Dim HasChildren As Boolean = BRApi.Finance.Members.HasChildren(si, EntityDimPK, ChildMember.MemberId, Nothing)
                    If Not HasChildren Then
                        ' Check if "YS" in name or description
                        If ChildName.ToUpper().Contains("YS") Or ChildDesc.ToUpper().Contains("YS") Then
                            ' Remove Relationship
 
                        End If
                    End If
                Next
 
                If RemovedEntities.Count = 0 Then
                    Return "No base children with 'YS' found under " & RollupName
                Else
                    Return "Removed from " & RollupName & ": " & String.Join(", ", RemovedEntities)
                End If

 

No RepliesBe the first to reply