R
Renraf
I have ticket data that creates a new record for every non-consecutive period
of time spent working a ticket. There is a field "TicketComplete" that will
be checked if the ticket is closed by the end of the stop time for that
record and unchecked if more work needs to be performed later.
I want to combine the information from each of the records that applies to
the same ticket. Here is what the data may look like:
Ticket, Start, Stop, TicketComplete
123, 9:00 AM, 9:30 AM, 0
ABC, 9:30 AM, 11:00 AM, -1
123, 11:00 AM, 11:50 AM, 0
(blank), 11:50 AM, 12:15 PM, -1
123, 12:15 PM, 12:50 PM, -1
(blank), 12:50 PM, 2:30 PM, -1
So, in the end, I want the min start time, max stop time, and sum of
TicketComplete for each ticket number, BUT I do not want to aggregate all of
the records with no ticket number. I want each to remain as its own entry
with the given Start, Stop, TicketComplete.
Advice? (Other than changing my data; I know it probably looks horribly
constructed, but it is consistent with the scenario in which we use it).
of time spent working a ticket. There is a field "TicketComplete" that will
be checked if the ticket is closed by the end of the stop time for that
record and unchecked if more work needs to be performed later.
I want to combine the information from each of the records that applies to
the same ticket. Here is what the data may look like:
Ticket, Start, Stop, TicketComplete
123, 9:00 AM, 9:30 AM, 0
ABC, 9:30 AM, 11:00 AM, -1
123, 11:00 AM, 11:50 AM, 0
(blank), 11:50 AM, 12:15 PM, -1
123, 12:15 PM, 12:50 PM, -1
(blank), 12:50 PM, 2:30 PM, -1
So, in the end, I want the min start time, max stop time, and sum of
TicketComplete for each ticket number, BUT I do not want to aggregate all of
the records with no ticket number. I want each to remain as its own entry
with the given Start, Stop, TicketComplete.
Advice? (Other than changing my data; I know it probably looks horribly
constructed, but it is consistent with the scenario in which we use it).