I have a data set that logs multiple individual's activities in a sequential chronological order. Each individual has a number of activity codes with a date/time stamp attached. I need to summarize time spent in each activity and calculate the total time spent at each activity during any given time period.
The data would look something like this:
occ_date unit_id activity_code activity_time
2001-01-01 3412 OS 11:23:02
2001-01-01 10613 IS 11:23:03
2001-01-01 9734 IS 11:23:04
2001-01-01 3412 ER 11:23:05
2001-01-01 3412 ER 11:23:06
.
.
.
2001-01-01 3412 OS 11:27:00
And the desired output would be, for all unit types, over any given time period, would be:
Activity Time Summary
Unit Activity
OS IS ER
3412 00:00:03 00:00:00 00:03:55
9734 ... ... ...
10613 ... ... ...
So, I need to calculate an elapsed time for each unit_id number on any change in activity_code - summarized daily/hourly so that higher aggregations of information can be produced. I have been doing this in a spreadsheet, but the process is starting to get unweildy and am wondering if Crystal can handle summarizing a file like this in the fashion...
Any ideas?
Fraser Moffatt
Ottawa Police Service
The data would look something like this:
occ_date unit_id activity_code activity_time
2001-01-01 3412 OS 11:23:02
2001-01-01 10613 IS 11:23:03
2001-01-01 9734 IS 11:23:04
2001-01-01 3412 ER 11:23:05
2001-01-01 3412 ER 11:23:06
.
.
.
2001-01-01 3412 OS 11:27:00
And the desired output would be, for all unit types, over any given time period, would be:
Activity Time Summary
Unit Activity
OS IS ER
3412 00:00:03 00:00:00 00:03:55
9734 ... ... ...
10613 ... ... ...
So, I need to calculate an elapsed time for each unit_id number on any change in activity_code - summarized daily/hourly so that higher aggregations of information can be produced. I have been doing this in a spreadsheet, but the process is starting to get unweildy and am wondering if Crystal can handle summarizing a file like this in the fashion...
Any ideas?
Fraser Moffatt
Ottawa Police Service