Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

javiervzaplana
New Contributor

Help Before in Script ETL

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!!!

2 Replies
shilpan9166
Contributor II

Re: Help Before in Script ETL

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

Re: Help Before in Script ETL

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?

Community Browser