6 Replies Latest reply on Nov 10, 2017 12:37 PM by Vikram Belathur

    @SLN function results going crazy

    3435003

      Hi,

       

      I am writing code to get monthly depreciations of project investments ("view.Investcost") given salvage value ("view.Salvagevalue") and life time ("view.Lifetime_mnth") as manual input:

        FIX(FY17:FY28)

         SET CREATEBLOCKONEQ ON;

                 "view.Depreciation"(

          IF(@ISMBR("acc.ProjInvest"))

         @SLN("view.Investcost","view.Salvagevalue"->"BegBalance"->"FY15", "view.Lifetime_mnth"->"BegBalance"->"FY15", @XRANGE("FY17"->Jan,"FY28"->Dec));

          ELSE

          #missing;

          ENDIF

          )

         SET CREATEBLOCKONEQ OFF;

      ENDFIX;

       

      where view.... are members of View dimension and acc... are members of Accounts dimension.

       

      The script is working but it gives e.g. when life time is 24 months, it spreads depreciation over all months of 12 years instead of just 2 years. Or even puts depreciation values on only jan-march of each of 12 years.

       

      Any ideas how to make it work properly?