0 Replies Latest reply: Jan 6, 2011 1:46 PM by user13382134 RSS

    How to reference a function in Rules

    user13382134
      I have a function that is not calculating the formula EBITDA_NetDebt when i reference it as a function. The incorrect amount that keeps pulling is the A#EBIT_UnrestCorpCash which is an entered value from a HFM journal.

      If i don't reference a function the formula EBITDA_NetDebt works fine by itself and calculates correctly.

      The function is supposed to have EBITDA_NetDebt pull a value from the function NetDebtCalc which needs to be zero before March 2009. i want it only showing a value on and after March 2009.

      here is the expression:
      Hs.Exp "A#EBITDA_NetDebt" & NonesNoC3 &"=" & NetDebtCalc()


      here is the function:
      Function NetDebtCalc()

           povYear = HS.Year.Member
           povPeriod = HS.Period.Member

           If povYear = 2009 Then
                If povPeriod = March Then
                     NetDebtCalc = "A#LTDebt" & TopsNoC3 & " + A#STBorrow" & TopsNoC3 & " + A#LTDebt_CurrPortion" & TopsNoC3 & " - A#200042" & TopsNoC3 & " - A#252014" & TopsNoC3 & " + A#250016" & TopsNoC3 & " - A#EBIT_UnrestCorpCash" & TopsNoC3
                End If
           ElseIf povYear > 2009 Then
                NetDebtCalc = "A#LTDebt" & TopsNoC3 & " + A#STBorrow" & TopsNoC3 & " + A#LTDebt_CurrPortion" & TopsNoC3 & " - A#200042" & TopsNoC3 & " - A#252014" & TopsNoC3 & " + A#250016" & TopsNoC3 & " - A#EBIT_UnrestCorpCash" & TopsNoC3
           Else
                NetDebtCalc = 0
           End If

      End Function


      can someone help?

      Thank you!

      Edited by: user13382134 on Jan 6, 2011 2:45 PM