Good afternoon,
I've spent several days trying to find a solution but having had no luck...
I have a dataset of phone records from a contact center showing every change in an agent's phone state - when agents take calls, are available, are at break or lunch or meeting, etc. Each event is generated as a line item with the following information:
inqueue | Agent ID | Start Time | End Time | Description |
Was the agent on a call or able to take a call? | The agent's unique ID from the phone system | The start date and time of the event | The end date and time of the event | The event's name/description |
To give an example:
inqueue | Agent ID | Start Time | End Time | description |
TRUE | 15 | 2/22/2023 9:52 | 2/22/2023 9:52 | Available |
TRUE | 15 | 2/22/2023 9:52 | 2/22/2023 9:55 | ACD |
TRUE | 15 | 2/22/2023 9:55 | 2/22/2023 9:56 | ACW |
TRUE | 15 | 2/22/2023 9:56 | 2/22/2023 10:02 | ACD |
TRUE | 15 | 2/22/2023 10:02 | 2/22/2023 10:03 | ACW |
FALSE | 15 | 2/22/2023 10:03 | 2/22/2023 10:16 | Break |
TRUE | 15 | 2/22/2023 10:16 | 2/22/2023 10:18 | Available |
TRUE | 15 | 2/22/2023 10:18 | 2/22/2023 10:19 | ACD |
So in this example, from 2/22, the agent was in queue from 9:52 AM to 10:03 AM. Then they were out of the queue from 10:03 AM to 10:16 AM. They were then in queue from 10:18 AM to 10:19. (Technically, it would be longer than that but I didn't want to throw dozens of rows into this)
Using the data above as an example, my desired output here would look like this:
inqueue | Agent ID | Start Time | End Time | description |
TRUE | 15 | 2/22/2023 9:52 | 2/22/2023 10:03 | |
FALSE | 15 | 2/22/2023 10:03 | 2/22/2023 10:16 | Break |
TRUE | 15 | 2/22/2023 10:16 | 2/22/2023 10:19 |
In short, giving me a start and end time for each sequence of events where the inqueue value is the same. (So if I have 25 consecutive records where inqueue is TRUE, I should get a summary of the start time and end time for just that sequence.)
I have looked at the Summarize tool - but could not figure out how to get the distinction of these breaks in the sequence. I've looked at multi-row formula, but the problem is that not all sequences are the same number of rows. If I were using Excel for this I'd have a few tricks I could use... but I need this in Alteryx because there is a lot more data than Excel can handle.
Any help is appreciated! Thank you in advance! :)
Something like this may work for you. I use a multi-row to just numerate when inqueue changes from true to false as its SequenceID. Then use it as one of the groupby conditions for the summarize. I also converted the date/times to date/time values instead of string to make sure that the min/max values are accurate.
I also used a formula to capture the descriptions of the false items and group by it as well.
User | Count |
---|---|
19 | |
15 | |
13 | |
9 | |
8 |