I'm having some problems with this dataset below and don't know what to do.
For each group of of common ids I want to delete their respective duplicates based on their status and their date and time stamp. If the status for all the common trade ids is "rejected" then I want to delete all trade id except the latest one submitted.
If the common trade ids all have statuses of "Accepted" I want to keep the earliest instance of this ID and delete all those ones that came after.
In all other cases, for instance if a group of common IDs have statuses of "Accepted" and "Rejected" then i want to keep the last submission and delete all other common trades.
The trades in bold below are the ones i want to keep. Any help would be greatly appreciated!
<TBODY>
</TBODY><COLGROUP><COL><COL><COL><COL></COLGROUP>
For each group of of common ids I want to delete their respective duplicates based on their status and their date and time stamp. If the status for all the common trade ids is "rejected" then I want to delete all trade id except the latest one submitted.
If the common trade ids all have statuses of "Accepted" I want to keep the earliest instance of this ID and delete all those ones that came after.
In all other cases, for instance if a group of common IDs have statuses of "Accepted" and "Rejected" then i want to keep the last submission and delete all other common trades.
The trades in bold below are the ones i want to keep. Any help would be greatly appreciated!
Submission Date</SPAN> | Time Stamp</SPAN> | ID</SPAN> | Status</SPAN> |
01/06/2015</SPAN> | 17:36:10</SPAN> | 116082XK</SPAN> | Rejected</SPAN> |
03/06/2015</SPAN> | 00:10:26</SPAN> | 116082XK</SPAN> | Rejected</SPAN> |
11/06/2015</SPAN> | 00:16:57</SPAN> | 116082XK</SPAN> | Rejected</SPAN> |
11/06/2015</SPAN> | 06:18:05</SPAN> | 116082XK</SPAN> | Rejected</SPAN> |
14/08/2015</SPAN> | 15:36:58</SPAN> | 116082XK</SPAN> | Rejected</SPAN> |
01/06/2015</SPAN> | 17:34:01</SPAN> | 117311XK</SPAN> | Accepted</SPAN> |
02/06/2015</SPAN> | 00:15:25</SPAN> | 117311XK</SPAN> | Accepted</SPAN> |
04/06/2015</SPAN> | 00:15:13</SPAN> | 117311XK</SPAN> | Accepted</SPAN> |
11/06/2015</SPAN> | 00:16:57</SPAN> | 117311XK</SPAN> | Accepted</SPAN> |
11/06/2015</SPAN> | 06:18:32</SPAN> | 117311XK</SPAN> | Accepted</SPAN> |
05/08/2015</SPAN> | 15:54:45</SPAN> | 117311XK</SPAN> | Accepted</SPAN> |
06/08/2015</SPAN> | 16:38:13</SPAN> | 117311XK</SPAN> | Accepted</SPAN> |
14/08/2015</SPAN> | 15:38:34</SPAN> | 117311XK</SPAN> | Accepted</SPAN> |
01/06/2015</SPAN> | 17:33:20</SPAN> | 118202XK</SPAN> | Rejected</SPAN> |
02/06/2015</SPAN> | 00:15:25</SPAN> | 118202XK</SPAN> | Rejected</SPAN> |
03/06/2015</SPAN> | 00:10:20</SPAN> | 118202XK</SPAN> | Rejected</SPAN> |
11/06/2015</SPAN> | 00:16:58</SPAN> | 118202XK</SPAN> | Rejected</SPAN> |
11/06/2015</SPAN> | 06:18:30</SPAN> | 118202XK</SPAN> | Rejected</SPAN> |
14/08/2015</SPAN> | 14:01:41</SPAN> | 118202XK</SPAN> | Accepted</SPAN> |
14/08/2015</SPAN> | 15:37:47</SPAN> | 118202XK</SPAN> | Rejected</SPAN> |
01/06/2015</SPAN> | 17:32:38</SPAN> | 110711XK</SPAN> | Rejected</SPAN> |
03/06/2015</SPAN> | 00:10:29</SPAN> | 110711XK</SPAN> | Rejected</SPAN> |
04/06/2015</SPAN> | 00:15:13</SPAN> | 110711XK</SPAN> | Rejected</SPAN> |
11/06/2015</SPAN> | 00:16:58</SPAN> | 110711XK</SPAN> | Rejected</SPAN> |
17/06/2015</SPAN> | 06:19:17</SPAN> | 110711XK</SPAN> | Rejected</SPAN> |
05/08/2015</SPAN> | 09:52:24</SPAN> | 110711XK</SPAN> | Rejected</SPAN> |
05/08/2015</SPAN> | 15:24:22</SPAN> | 110711XK</SPAN> | Accepted</SPAN> |
<TBODY>
</TBODY><COLGROUP><COL><COL><COL><COL></COLGROUP>