Forum Discussion
Mike_Sabourin
2 years agoContributor II
I had a similar use case, and what I did was create a UD8 member named Ent_By_Text to total up using a text field
Dim viewMember As ViewMember = ViewMember.GetItem(api.Pov.View.MemberPk.MemberId)
If viewMember.IsAnnotationType Then
' Return an empty string if this is a text-based dataCell.
Return ""
End If
Dim MGMTid As Integer = api.Members.GetMemberId(DimType.Entity.Id, "MGMT") 'Where "MGMT" is the top-most entity in the hierarchy
Dim baseEnts As List(Of Member) = api.Members.GetBaseMembers(api.Pov.EntityDim.DimPk, MGMTid, Nothing)
Dim povText As String = api.Entity.Text(3)
Dim LocTot As Decimal = 0
If Not baseEnts Is Nothing Then
For Each CurrEnt As Member In baseEnts
Dim currText As String= api.Entity.Text(current.MemberId,3)
If currText = povText Then
LocTot = LocTot + api.Data.GetDataCell("E#" & CurrEnt.Name & ":T#[" + api.Pov.Time.Name _
+ "]:V#" & api.Pov.View.Name & ":C#" & api.Pov.Cons.Name & _
":O#Top:I#Top:F#Top:U1#Top:U2#Top:U3#Top:U4#" & api.Pov.UD4.Name & _
":U5#Top:U6#None:U7#None:U8#None").CellAmount
'brapi.ErrorLog.LogMessage(si, "Test-Entity~" & CurrEnt.Name & "~povText~" _
' & povText & "~currText~" & currText & "~LocTot~" & LocTot)
Else
LocTot = LocTot
End If 'If TargetCurr = povCurr Then
Next 'CurrEnt
If LocTot <> 0 Then
Return LocTot
Else
Return Nothing
End If
Else
Return Nothing
End If 'If Not baseEnts Is Nothing Then
Related Content
- 3 months ago
- 10 months ago
- 8 months ago