0 Replies Latest reply: Nov 28, 2012 1:12 AM by 861688 RSS

    How to write Consolidation rule and Elimination rule for 3 level Entity Dim

    861688
      Dear All,

      At Present we have 2 levels of Entity dimension and Exist rule is working fine. we have created new Hierarchy with 3 level in Entity dimension, but Elimination rule is not working to newly created 3 level Hieratchy. Please help me to write/ modify exist rule. see the below existing rule.
      --------------------------------------------------------------------------------------------------------------------------------
      Sub Consolidate()

      Method=HS.Node.Method("")
      PCon=HS.Node.PCon("")
      POwn=HS.Node.POwn("")
      PMin=PCon-POwn
      DIMFA01=".C1#Movement.C3#[None].I#[ICP None]"     
      DIMFA02=".C1#[None].C3#[None].I#[ICP None]"
      ELIM=".V#[Elimination]"
      BSG="Gross Block"
      BSD="Acc Depreciation"
      Set DataUnit=HS.OpenDataUnit("")
      CanEliminate = TRUE
      NumItems=DataUnit.GetNumItems


           For i=0 to NumItems-1
           Call DataUnit.GetItem(i,Account,ICP,Custom1,Custom2,Custom3,Custom4,Data)
                Call SetICP(ICP,ICPMethod)
                If Account="S1635" Then
                          Comm="Pro Elim-FA"
                ElseIf Account="S164" Then
                          Comm="Pro Elim-Inv"
                End If
                If Method="Holding" Then     
                          Call HS.Con("",PCon,"")

                          Call ICPELIM(Account, ICP, ICPMethod)
                End If
                If Method="Subsidiary" Then
                          Call HS.Con("",PCon,"")
                     
                     
                     If Account="S1723" Then
                          Call HS.Con("A#I10.V#[Elimination]",(-1)*PMin,"P&L MI")
                          Call HS.Con("A#I4023.V#[Elimination]",PMin,"P&L MI")
                     End IF
                     
                     Call ICPELIM(Account, ICP, ICPMethod)
                End if          
                If Method="SUB_DIS" then
                     If Hs.Account.Isbase("Net Income",Account) Then
                          Call Hs.Con("",PCon,"Disposal")
                          Call HS.Con("A#38010001",(-1)*PCon,"Disposal")
                     End IF
                     If Account="S1723" Then
                          Call Hs.Con("A#I10",(-1)*PMin,"")
                          Call Hs.Con("A#38010001",PMin,"")
                     End If
                     If Hs.Account.Isbase("1020",Account) Then
                          Call Hs.Con("",PCon,"")
                          Call Hs.Con("A#38010001",(-1)*PCon,"")
                     End If
                     If Hs.Account.Isbase("S241","")= TRUE or Hs.Account.Isbase("S242","")= TRUE Then
                          Call Hs.Con("",PCon,"")
                     End If
                End IF
                If Method="Equity" then ' changes made by manoj on4th feb -- to be discussed with varun
                     If Account="S1723" Then
                     Call HS.Con("A#I62.C1#[None]",PCon,"Equity")
                     Call HS.Con("A#210045.C1#Movement",(-1)*PCOn,"Equity")
                     Call HS.Con("A#S17242",PCon,"")

                     Call Hs.Con("A#I4023.C1#Movement",PMin,"Equity")
                     Call Hs.Con("A#I10.C1#[None]",(-1)*PMin,"Equity")

                     ElseIf Account="102021" then
                     Call HS.Con("A#210045.C1#Movement",(-1)*PCon,"")
                     Call HS.Con("C1#Movement",PCon,"")
                     Call HS.Con("A#S17242",PCon,"")

                     Call Hs.Con("A#I4023.C1#Movement",(-1)*PMin,"")
                     Call HS.Con("",PMin,"")               

                     ElseIf Account="S17241" then
                     Call HS.Con("A#S17242",(-1)*POwn,"")
                     End If
                End If
                If Method="JV" Then ' changes made by manoj on4th feb -- to be discussed with varun
                     If Account="S1723" Then
                     Call HS.Con("A#I64.C1#[None]",PCon,"JV")
                     Call HS.Con("A#21003001.C1#Movement",(-1)*PCon,"JV")
                     Call HS.Con("A#S17243",PCon,"")

                     Call Hs.Con("A#I4023.C1#Movement",PMin,"JV")
                     Call Hs.Con("A#I10.C1#[None]",(-1)*PMin,"JV")

                     ElseIf Account="102021" then
                     Call HS.Con("A#21003001.C1#Movement",(-1)*PCon,"")
                     Call HS.Con("C1#Movement",PCon,"")
                     Call HS.Con("A#S17243",PCon,"")

                     Call Hs.Con("A#I4023.C1#Movement",(-1)*PMin,"")
                     Call HS.Con("",PMin,"")               

                     ElseIf Account="S17241" then
                     Call HS.Con("A#S17243",(-1)*POwn,"")
                     End If
                End If
           NEXT
      End sub

      Sub ICPELIM(Account, ICP, ICP_Partner)
      Dim CanEliminate
      Dim dPCon
      CanEliminate = TRUE

           If ICP="[ICP None]" or (ICP_Partner<>"Subsidiary" and ICP_Partner<>"Holding") Then
                CanEliminate= FALSE
           End IF
      If (HS.Account.IsICP(Account) = FALSE) Then
      CanEliminate = FALSE
      Else
      strACC = HS.Account.PlugAcct(Account)
      If (strACC = "") Then CanEliminate = FALSE
      End If
      If CanEliminate Then
      dPCon = HS.Node.PCon("")
      call HS.Con("V#[Elimination]",-1*dPCon,"")     
      call HS.Con("V#[Elimination].A#" & strACC,dPCon,"")     
      End If
      End Sub
      ---------------------------------------------------------------------------------------------------------------------------------------


      Thanks in Advance,
      Janardhan
      Essar Group