Forum Discussion

kstandifer's avatar
kstandifer
New Contributor
2 years ago

calculate on entity

I am trying to do a calculation for a few specified members (putting to E and U4) but only for base of certain hierarchies under Account and UD1. 

Here is the example of what we want to do: api.Data.Calculate("E#NonRolled:O#BeforeElim:F#EndBal:U4#NonRolled_Calc = RemoveZeros(E#1000X:O#BeforeElim:F#EndBal:U4#Reported - E#2000X:O#BeforeElim:F#EndBal:U4#Reported )","A#Management_Income_Statement.base")

However, I understand you can not have Entity as part of the left hand side the equation since it would create an invalid data unit. Does anyone know a way around this, or an alternate way to accomplish this?

 

  • Manasa's avatar
    Manasa
    New Contributor III

    Hi, 

    you can place your calculation within if condition,

    Dim curEntity As String = api.Pov.Entity.Name
    If curEntity.XFEqualsIgnoreCase("NonRolled") Then
     api.Data.Calculate("O#BeforeElim:F#EndBal:U4#NonRolled_Calc = RemoveZeros(E#1000X:O#BeforeElim:F#EndBal:U4#Reported - E#2000X:O#BeforeElim:F#EndBal:U4#Reported )","A#Management_Income_Statement.base")
    End If