I Have data like this data=bookings ID Arrest_charge Date 1 PC187 3/20/15 1 WIC 122.4 6/15/15 2 PC 71 6/30/12 2 PC988 6/30/14 2 PC141 7/14/15 3 VC340 8/9/10 4 PC251.1(A) 8/17/11 4 VC241(B) 9/23/11 I want to collapse the data so that each unique ID is one observation, but retain all the information creating new variables that extend horizontally depending on how many arrest records there are for each unique ID. Like this. ID Arrest_charge1 Date1 arrest_charge2 date2 arrest_charge3 Date3 1 PC187 3/20/15 WIC 122.4 6/15/15 . . 2 PC71 6/30/12 PC988 6/30/14 PC141 7/14/15 3 VC340 8/9/10 . . . . 4 PC251.1(A) 8/17/11 VC241(B) 9/23/11 . . . or dot indicates a value that is missing because there was not that many charges and dates per booking (i know . is for numerical values and im working with codes. Please help me im lost. Do i need to write a macro if i dont want to create variables for the max number of charges and dates? I tried a bunch of things but none seem to retain all info just one of the observations. thanks. -Matt
... View more