Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

adding up data during load

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 ?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

I think you want something like this:

Table:

LOAD

ID_item,

Amount,

rangesum(peek('Added_Amount'),Amount) as Added_Amount

FROM ...somewhere...;


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

I think you want something like this:

Table:

LOAD

ID_item,

Amount,

rangesum(peek('Added_Amount'),Amount) as Added_Amount

FROM ...somewhere...;


talk is cheap, supply exceeds demand
Not applicable
Author

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?

Not applicable
Author

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.