The table (which is a part of a workflow database and captures the history for items going through workflow) has the following structure (I am only listing relevant fields): UserID, ItemID, Reason (can be "Held", "Viewed", "Cancelled", "Routed In", "Routed Out", InstanceTime (Time Stamp).
Data Example:
UserID ItemID Reason InstanceTime
UserA 1234 Routed In 10:00:30
UserA 1234 Held 10:01:00
UserB 1234 Viewed 10:02:00
UserB 1234 Held 10:05:00
UserA 1234 Viewed 10:10:00
UserC 1234 Held 10:10:05
UserA 1234 Cancelled 10:10:15
UserA 1234 Held 10:11:10
UserA 1234 Cancelled 10:11:25
UserA 1234 Routed Out 10:12:00
The report needs to calculate time on hold (difference between reason "Held" and whatever Reason follows "Held", ordered by ItemID and InstanceTime by item and charge it to the user who put the item on hold (but hold time cannot be calculated until the item has been taken off hold). For the data example, total hold time for UserA should be 1 minutes 15 seconds (1 minute + 15 seconds), for UserB 5 minutes, and for UserC 10 seconds. The report cannot be grouped by UserID as you would lose the actions UserB and UserC performed.
I have received a suggestion to create a multi-dimensional array but I am not sure whether that is really the way to go or how to create one (the report has to be created in Crystal Reports 8.5, Crystal Analysis is not an option).
Thank you very much in advance for your help.
Data Example:
UserID ItemID Reason InstanceTime
UserA 1234 Routed In 10:00:30
UserA 1234 Held 10:01:00
UserB 1234 Viewed 10:02:00
UserB 1234 Held 10:05:00
UserA 1234 Viewed 10:10:00
UserC 1234 Held 10:10:05
UserA 1234 Cancelled 10:10:15
UserA 1234 Held 10:11:10
UserA 1234 Cancelled 10:11:25
UserA 1234 Routed Out 10:12:00
The report needs to calculate time on hold (difference between reason "Held" and whatever Reason follows "Held", ordered by ItemID and InstanceTime by item and charge it to the user who put the item on hold (but hold time cannot be calculated until the item has been taken off hold). For the data example, total hold time for UserA should be 1 minutes 15 seconds (1 minute + 15 seconds), for UserB 5 minutes, and for UserC 10 seconds. The report cannot be grouped by UserID as you would lose the actions UserB and UserC performed.
I have received a suggestion to create a multi-dimensional array but I am not sure whether that is really the way to go or how to create one (the report has to be created in Crystal Reports 8.5, Crystal Analysis is not an option).
Thank you very much in advance for your help.