Need to add if condition in the account formula for entity specific execution
- 4 years ago
Hi Yashwant,
Api.pov.Entity.Name should do the trick.
- 4 years ago
Hi Yashwant,
api.Pov.Entity.Name
Lee
- 4 years ago
Yes, you can use api.Members.IsBase - see below.
'Get DimPk for POV Entity Dimension
Dim objDimPk As DimPk = api.Pov.EntityDim.DimPk
'Get Member ID for POV Entity Member
Dim entityID As Integer = api.Pov.Entity.MemberId
'Get Member ID for selected ancestor
Dim ancestorID As Integer = api.Members.GetMember(DimType.Entity.Id,"GroupGBP").MemberId'Run only on base entities of selected ancestor
If api.Members.IsBase(objDimPk, ancestorID, entityID) Then
api.data.calculate("A#Check = A#Check1")
End IfLee
- 4 years ago
There is also a api.pov.parent, but it only works for relationship related consolidation members like elimination or share.
Alternative to Lee's solution, you can also work with api.members.getparents(...) or api.members.getchildren(..) and check if the requested parent/member is in the result list, this might be helpfull if you have to repeat the check or if you like to test more than one parent.
somthing like this:
Dim parentList As list(Of member) = api.members.getParents(api.Pov.EntityDim.DimPk, api.pov.entity.memberid, False) If Not parentList.Find(Function(x) x.Name="ParentName") Is Nothing End If Dim parentID As Integer = api.Members.GetMemberId(dimtypeid.Entity, "ParentName") Dim childrenList As list(Of member) = api.members.GetChildren(api.Pov.EntityDim.DimPk, parentID) If Not childrenList.Find(Function(x) x.MemberId=api.pov.Entity.MemberId) Is Nothing End If
You should also consider, to use a text attribute to identify the entities for the calculation: api.Entity.Text(1) = "Calc".