Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
i have the following tables
| ID | Orders | Month |
|---|---|---|
| 1 | 2 | 2011-01 |
| 1 | 5 | 2011-02 |
| 1 | 0 | 2011-03 |
| 1 | 1 | 2011-04 |
| 2 | 1 | 2011-01 |
| 2 | 2 | 2011-02 |
| 2 | 1 | 2011-03 |
| 2 | 0 | 2011-04 |
Now i want to add a column that keeps the aggregation of all orders up to the record's row. Like this:
| ID | Orders | Month | OrderAggregates |
|---|---|---|---|
| 1 | 2 | 2011-01 | 2 |
| 1 | 5 | 2011-02 | 7 |
| 1 | 0 | 2011-03 | 7 |
| 1 | 1 | 2011-04 | 8 |
| 2 | 1 | 2011-01 | 1 |
| 2 | 2 | 2011-02 | 3 |
| 2 | 1 | 2011-03 | 4 |
| 2 | 0 | 2011-04 | 4 |
How can i do this ?
Thanks a lot!
Try this:
Load ID, Orders, Mont, numsum( Orders, peek( 'OrderAggregates' ) ) as OrderAggregates
resident "OriginalTable";
Hi,
In load script or in charts?
Celambarasan
In LOAD