2 Replies Latest reply: Feb 26, 2018 4:21 AM by Peter Cammaert RSS

    Help Before in Script ETL

    javier zap

      Hello! I need help, I have this code in a graphic but I want to write it in the ETL script


      (sum(I_INDICADOR)+rangesum(before(sum(I_INDICADOR),1,12))+after(sum(IMPORTE)+rangesum(After(sum(IMPORTE),1,12))))


      thanks!!!

        • Re: Help Before in Script ETL
          Shilpan Patel

          rangesum works both in script and chart but after works only in chart.

          • Re: Help Before in Script ETL
            Peter Cammaert

            You cannot translate this kind of expression 1:1 into a script statement, because

            • before and after are not available in your load script. There isn't even a function that comes close. You can however mimic this behavior using some pretty complex code, but that wouldn't be very efficient.
            • there is no object with rows/columns to pick values before() / after(). There is just a single internal table with rows that you can GROUP BY into another table.
            • in your expression you can easily aggregate fields from different tables, but in a script that would require explicit JOINS.

             

            IMHO it would be better if you describe your internal table(s) in your data model and the expected output per set of GROUP BY fields. Would that be possible?