Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
marcel_olmo
Partner Ambassador
Partner Ambassador

Max Amount per Date Accumulated

Hi guys,

I have a table like this :

1.png

And I'd like to get a result like this :

And I'd like to get an accumulate of the amounts in another table like this :

2.png

How can I get that?

Regards, Marcel.

                            

DateAmountAcc Amount
04/05/201755
04/05/201710001005
04/05/201701005
04/05/201701005
1 Solution

Accepted Solutions
swuehl
MVP
MVP

Why do you want the same constant date in the first column in your resulting table?

And what determines the four rows then ?

If that's a typo, order your table by Date and use Rangesum(Peek() ) combination for accumulation:

RESULT:

LOAD

     Date,

     Amount,

     Rangesum(Amount, Peek(AccAmount)) as AccAmount

RESIDENT INPUT

ORDER BY Date;

DROP TABLE INPUT;

View solution in original post

2 Replies
swuehl
MVP
MVP

Why do you want the same constant date in the first column in your resulting table?

And what determines the four rows then ?

If that's a typo, order your table by Date and use Rangesum(Peek() ) combination for accumulation:

RESULT:

LOAD

     Date,

     Amount,

     Rangesum(Amount, Peek(AccAmount)) as AccAmount

RESIDENT INPUT

ORDER BY Date;

DROP TABLE INPUT;

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Thanks Stefan! That was it.

Regards, Marcel.