Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all
I have table with values LoadID, value, event_order_id and I'm trying to have cumulative sum / loadid in correct order / cirteria as in the example below.
The calculation for the cumulative sum for LoadID 413465 should go like this.
when event_order_id = 1 the sum is value,
when event_order_id = 2 the sum is value of the id 1 + value of the id 2
when event_order_id = 3 the sum is value of the id 1 + value of the id 2 + value of the id 3
LoadID | value | event_order_id | cumulative sum / loadid |
413465 | 11,845 | 1 | 11,845 |
413465 | -0,336 | 2 | 11,509 |
413465 | -11,509 | 3 | 0,000 |
413490 | 3,616 | 1 | 3,616 |
413490 | 8,125 | 2 | 11,741 |
413490 | -6,982 | 3 | 4,759 |
413490 | -1,143 | 4 | 3,616 |
413490 | -3,616 | 5 | 0,000 |
413507 | 7,853 | 1 | 7,853 |
413507 | 1,259 | 2 | 9,112 |
413507 | -1,259 | 3 | 7,853 |
413507 | 1,149 | 4 | 5,488 |
413507 | -2,365 | 5 | 3,123 |
413507 | -3,340 | 6 | -0,217 |
413507 | -2,217 | 7 | -2,434 |
413507 | -1,080 | 8 | -3,514 |
Is the some kind of aggr / range sum function that I should use or some kind of Do while ... loop
Hi Sunny,
Am in a similar situation but I am doing in a Vizlib Table with 1 dimension called Brand,
sorting is working only if I remove the cumulative calculation from the table
Thanks,
Nagarjun