Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Summarizing Timestamp data from multiple rows

mosterman
5 - Atom

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: 

 

inqueueAgent IDStart TimeEnd TimeDescription
Was the agent on a call or able to take a call?The agent's unique ID from the phone systemThe start date and time of the eventThe end date and time of the eventThe event's name/description

 

To give an example: 

 

inqueueAgent IDStart TimeEnd Timedescription
TRUE152/22/2023 9:522/22/2023 9:52Available
TRUE152/22/2023 9:522/22/2023 9:55ACD
TRUE152/22/2023 9:552/22/2023 9:56ACW
TRUE152/22/2023 9:562/22/2023 10:02ACD
TRUE152/22/2023 10:022/22/2023 10:03ACW
FALSE152/22/2023 10:032/22/2023 10:16Break
TRUE152/22/2023 10:162/22/2023 10:18Available
TRUE152/22/2023 10:182/22/2023 10:19ACD

 

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: 

 

inqueueAgent IDStart TimeEnd Timedescription
TRUE152/22/2023 9:522/22/2023 10:03 
FALSE152/22/2023 10:032/22/2023 10:16Break
TRUE152/22/2023 10:162/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! :)

 

1 REPLY 1
SPetrie
13 - Pulsar

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.

SPetrie_1-1679513503647.png

 

SPetrie_0-1679513438001.png

 

Labels
Top Solution Authors