Order Type count
Obs CustomerID OrderDate DeliveryDate OrderType Quantity
89 | 03JAN2011 | 04JAN2011 | 1 | 6 |
89 | 01OCT2011 | 01OCT2011 | 1 | 1 |
89 | 01OCT2011 | 01OCT2011 | 1 | 1 |
89 | 15DEC2011 | 15DEC2011 | 1 | 4 |
89 | 17JUN2011 | 21JUN2011 | 2 | 2 |
2550 | 04MAY2011 | 09MAY2011 | 3 | 3 |
2550 | 04MAY2011 | 09MAY2011 | 3 | 1 |
These are the two tables (let's call them table1 and table2). I have to combine these two tables
and change it into one where there is only one observation for each ordertype.
It would have to look like (this is only part of it):
Obs OrderDate1 OrderDate2 OrderDate3 OrderDate4 DeliveryDate1123
03JAN2011 | 01OCT2011 | 01OCT2011 | 04JAN2011 | 01OCT2011 |
17JUN2011 | . | | 21JUN2011 | . |
04MAY2011 | 04MAY2011 | | 09MAY2011 | 09MAY2011 |
| | | | |
| | | | |
| | | | |
| | | | |
I don't need help with everything.. I need to use arrays to built this dataset, but I can't seem to get it.
I tried to do the first part of only the orderdate, but obviously that didn't work.
Data orderfact;
array order{4} OrderedDate1 OrderedDate2 OrderedDate3 OrderedDate4;
do i = 1 to 7;
set orderfact;
by OrderType;
order{OrderType} = OrderedDate;
end;
run;