Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Incoming data looks like below
| VBELN | MATNR | Bill.Date | QTY |
| 101 | XX1 | 1/3/2012 | 10 |
| 102 | XX1 | 1/5/2012 | 5 |
| 103 | YYY | 1/4/2012 | 5 |
| 104 | YYY | 1/6/2012 | 20 |
| 105 | XX1 | 2/2/2012 | 50 |
| 106 | XX1 | 2/28/2012 | 3 |
| 107 | YYY | 2/25/2012 | 2 |
| 108 | XX1 | 3/3/2012 | 9 |
| 109 | YYY | 3/3/2012 | 10 |
| 110 | XX1 | 3/19/2012 | 6 |
Expecting Results - during the time of the dataload (script)
| MATNR | Jan-12 | Feb-12 | Mar-12 |
| XX1 | 15 | 53 | 19 |
| YYY | 25 | 2 | 10 |
We can do like this in the pivot table.The problem is -I have to add additional few columns after Mar-12.
Pivot table will not work. Is there any better way to handle in the script.(Millions of record in the table).
Advance Thanks for your help.
It will be:
data:
LOAD
MATNR,
date(monthstart("Bill.Date"), 'MMM-YY') as Month,
sum(QTY) as QTY
FROM <your file>
GROUP BY MATNR, monthstart("Bill.Date");
Regards,
Michael
PS: it will be a little different if you load from a database, but the logic is the same.