hi guys,
I have a set of data with 1 row for each date/staff/event, is it possible to consolidate them so that it shows the start and end date if the staff number and the code are the same? if the dates break the sequence then I would like it to list as a separate row?
thanks,
Joe
e.g. Current data set
<tbody>
</tbody><colgroup><col><col><col span="2"></colgroup>
Consolidated data set:
<tbody>
</tbody><colgroup><col><col><col span="2"></colgroup>
I have a set of data with 1 row for each date/staff/event, is it possible to consolidate them so that it shows the start and end date if the staff number and the code are the same? if the dates break the sequence then I would like it to list as a separate row?
thanks,
Joe
e.g. Current data set
Staff Number | Start date | End date | Code |
219 | 8-Jan-18 | 8-Jan-18 | Leave |
219 | 9-Jan-18 | 9-Jan-18 | Leave |
219 | 10-Jan-18 | 10-Jan-18 | Leave |
219 | 11-Jan-18 | 11-Jan-18 | Leave |
219 | 12-Jan-18 | 12-Jan-18 | Leave |
219 | 13-Jan-18 | 13-Jan-18 | Leave |
219 | 14-Jan-18 | 14-Jan-18 | Leave |
219 | 15-Jan-18 | 15-Jan-18 | Leave |
219 | 16-Jan-18 | 16-Jan-18 | Leave |
219 | 17-Jan-18 | 17-Jan-18 | Leave |
219 | 18-Jan-18 | 18-Jan-18 | Leave |
219 | 19-Jan-18 | 19-Jan-18 | Leave |
219 | 20-Jan-18 | 20-Jan-18 | Leave |
219 | 21-Jan-18 | 21-Jan-18 | Leave |
219 | 12-Feb-18 | 4-Mar-18 | Leave |
227 | 8-Jan-18 | 8-Jan-18 | OFFLN |
227 | 9-Jan-18 | 9-Jan-18 | OFFLN |
232 | 8-Jan-18 | 8-Jan-18 | Leave |
232 | 9-Jan-18 | 9-Jan-18 | Leave |
232 | 10-Jan-18 | 10-Jan-18 | Leave |
232 | 11-Jan-18 | 11-Jan-18 | Leave |
232 | 12-Jan-18 | 12-Jan-18 | OFFLN |
232 | 13-Jan-18 | 13-Jan-18 | OFFLN |
232 | 14-Jan-18 | 14-Jan-18 | OFFLN |
<tbody>
</tbody><colgroup><col><col><col span="2"></colgroup>
Consolidated data set:
Staff Number | Start date | End date | Code |
219 | 8-Jan-18 | 21-Jan-18 | Leave |
219 | 12-Feb-18 | 4-Mar-18 | Leave |
227 | 8-Jan-18 | 9-Jan-18 | OFFLN |
232 | 8-Jan-18 | 11-Jan-18 | Leave |
232 | 12-Jan-18 | 14-Jan-18 | OFFLN |
<tbody>
</tbody><colgroup><col><col><col span="2"></colgroup>