Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
is it possible to add up data during the LOAD process ?
There is certain Data which has to add up, but the source provides only the amount per month
F.e.
tmp_table:
LOAD
ID_item,
'0' as Added_Amount // initializing the Collumn
next_Table:
LOAD
ID_item,
Amount,
Amount+Added_Amount as Added_Amount
of course this example doesnt really work, because the script would have to look in the last recent data of the item.
Any suggestions ?
I think you want something like this:
Table:
LOAD
ID_item,
Amount,
rangesum(peek('Added_Amount'),Amount) as Added_Amount
FROM ...somewhere...;
I think you want something like this:
Table:
LOAD
ID_item,
Amount,
rangesum(peek('Added_Amount'),Amount) as Added_Amount
FROM ...somewhere...;
Can you do that in the next step?? load all the data, and then join it with a new column that do the sum??
Or maybe build a new table at the end, that group by ID_Item and do the sum of AMOUNT??
do you have an example?
tried that, didn't work because it cant "remember" the sum from the data-set before the current one.
join only seems to work if adding or calculationg data of the current set or one linked to it.