Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everybody!
Don't know how to do this and my head is fully broken because of my task.
There is Sales table like this:
MonthName | CustomerID | MonthSum |
---|---|---|
jan 2014 | 1 | 150 |
feb 2014 | 1 | 120 |
jan 2014 | 2 | 180 |
mar 2014 | 2 | 140 |
feb 2014 | 3 | 120 |
Script is simple:
Tab1:
LOAD
MonthName(date) as Month,
CustomerID,
round(Sum(Sales)) as MonthSum
Resident Orders Group By CustomerID, (MonthName(date));
I need table with no-sales-months and with progressive total field, something like this:
MonthName | CustomerID | MonthSum | ProgrTotal |
---|---|---|---|
jan 2014 | 1 | 150 | 150 |
feb 2014 | 1 | 120 | 270 |
mar 2014 | 1 | 0 | 270 |
jan 2014 | 2 | 180 | 180 |
feb 2014 | 2 | 0 | 180 |
mar 2014 | 2 | 140 | 320 |
jan 2014 | 3 | 0 | 0 |
feb 2014 | 3 | 120 | 120 |
mar 2014 | 3 | 0 | 120 |
Hope you have more experience and more stable brains instead of me!
Waiting for your help!!
P. S. I need it in script. I've made the table with progressive total but without no-sales-months)
See attached qvw.
Genius!! You helped me a lot!