Skip to main content
November 16, 2023

calculate on entity

  • November 16, 2023
  • 1 reply
  • 0 views

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?

 

1 reply

November 17, 2023

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