3 Replies Latest reply: Nov 3, 2016 8:08 PM by Marco Wedel RSS

    load script '+'

    Alessandro Agostini

      Is it possibile to sum in load script as listed below (in red)?

      Thank you

       

      LOAD

      CONTO_COSTO,

      CAUSALE_CONTOCOSTO,

      IMPORTO_CONTO_COSTO,

      IF(CONTO_COSTO>='0601000001' AND CONTO_COSTO<='0601999999', IMPORTO_CONTO_COSTO) AS W_AN_PROD,

      IF(CONTO_COSTO>='0602000001' AND CONTO_COSTO<='0602999999', IMPORTO_CONTO_COSTO) AS W_AN_LAVORAZIONE,

      ((IF(CONTO_COSTO>='0601000001' AND CONTO_COSTO<='0601999999', IMPORTO_CONTO_COSTO))+(IF(CONTO_COSTO>='0602000001' AND CONTO_COSTO<='0602999999',IMPORTO_CONTO_COSTO))) AS W_AN_TEST;

        • Re: load script '+'
          Sunny Talwar

          Not sure what the intent is because CONTO_COSTO will either fall in the first if or second if and the other will be just 0. If this is what you want, you can try this:

           

          RangeSum(

          If(CONTO_COSTO>='0601000001' AND CONTO_COSTO<='0601999999', IMPORTO_CONTO_COSTO), If(CONTO_COSTO>='0602000001' AND CONTO_COSTO<='0602999999',IMPORTO_CONTO_COSTO)) AS W_AN_TEST;

          • Re: load script '+'
            Avinash R

            If IMPORTO_CONTO_COSTO is a number filed its possible but as per your condition


            the CONTO_COSTO will fall in any of the 1 interval so the other part will be always zero..

            ((IF(CONTO_COSTO>='0601000001' AND CONTO_COSTO<='0601999999', IMPORTO_CONTO_COSTO))


            OR


            for the primary key you have the dates for both the interval ??

            • Re: load script '+'
              Marco Wedel

              IF(CONTO_COSTO>='0601000001' AND CONTO_COSTO<='0602999999'  AND CONTO_COSTO<>'0602000000' ,IMPORTO_CONTO_COSTO) AS W_AN_TEST