A little bit different from your example case, because the client's needs didn't include P&L. What we did was create a Non-Controlling Interest account that loops through all the entities and checks the ownership type. When it finds the "NonControllingInterest" type, it stores the percentage of ownership. it runs through and creates a running total of the equity from those entities * the ownership percentage. If you want to adapt this, just replace the TOP_ENTITY member with whatever your topmost entity is and the Min_Int_Acct with the account number you create.
Dim debugSwitch As Boolean = False '<----- Turn on the debug switch To Log debug messages
Dim ePOV As String = api.Pov.Entity.Name
Dim tPOV As String = api.Pov.Time.Name
If ePOV = "TOP_ENTITY" Then
Dim entityDimPk As DimPk = api.Pov.EntityDim.DimPk
Dim ePovId As Integer = api.Pov.Entity.MemberId
Dim topEntityParent = api.Members.GetMemberId(DimType.Entity.Id, "E#TOP_ENTITY")
'Get base Entity members
Dim allMembers As List(Of Member) = api.Members.GetDescendants(entityDimPk, ePovId) 'GetAllMembers(EntityDimPk)
Dim ScenName As String = api.Pov.Scenario.Name
Dim RunTotal As Decimal
If Not allMembers Is Nothing Then 'Check to make sure the list is populated
For Each objMember As Member In allMembers
Dim CurrEnt As String = objMember.Name
Dim entId As Integer = objMember.MemberId
Dim parList As List(Of Member) = api.Members.GetParents(entityDimPk, entId, False)
For Each parMe As Member In parList
Dim ParId As Integer = parMe.MemberId
Dim IsPar As Boolean = api.Members.HasChildren(entityDimPk, entId)
If IsPar = True Then
Dim OwnType As String = api.Entity.OwnershipType(entId, ParId, -1, -1).ToString
Dim RateMe As Decimal = 1 - (api.Entity.PercentOwnership(entId, ParId, -1, -1) / 100)
Dim TextMe As String = api.Entity.Text(entId, 1)
If OwnType = "NonControllingInterest" Then
Dim TotAmt As Decimal = api.Data.GetDataCell("E#" & CurrEnt & ":C#USD:S#" & ScenName & ":V#Periodic:A#Equity:F#EndBal:O#Top:I#Top:U1#Tot_Consol:U2#Top_Departments:U3#None:U4#None:U5#None:U6#None:U7#None:U8#None").CellAmount
If Not TotAmt = 0 Then
RunTotal = RunTotal + (TotAmt * RateMe)
'********* debug info *********
If debugSwitch = True Then brapi.ErrorLog.LogMessage(si, "33000:CurrEnt=" & CurrEnt & "~EntId=" & entId & "~ParID=" & ParId & "~OwnType=" & OwnType & "~Rate=" & RateMe & "~Text1=" & TextMe & "~TotAmt=" & TotAmt & "~RunTotal=" & RunTotal)
'******************************
End If
End If
End If
Next ' parme
Next 'objmember
api.Data.Calculate("A#Min_Int_Acct:E#TOP_ENTITY:S#" & ScenName & ":V#Periodic:F#EndBal:O#AdjInput:I#None:U1#None:U2#None:U3#None:U4#None:U5#None:U6#None:U7#None:U8#None = " & RunTotal)
End If
End If