Need help in grouping data based on minimum time and maximum time interval.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have dataset in which i need to group by data based on time interval for employees. Data set is having employee id, date, Time interval for each employee.
Input looks like:
Emp_Id | Date | Time interval |
879362 | 28/10/2023 | 09:00 |
879362 | 28/10/2023 | 10:00 |
879362 | 28/10/2023 | 11:00 |
879362 | 28/10/2023 | 12:30 |
879362 | 28/10/2023 | 14:30 |
879362 | 28/10/2023 | 18:00 |
686666 | 28/10/2023 | 08:00 |
686666 | 28/10/2023 | 09:30 |
686666 | 28/10/2023 | 12:30 |
686666 | 28/10/2023 | 14:00 |
As you see emp_id 879362 and 686666 is having multiple records for same date but the time interval is different every time. So in the output I expect to see only start (minimum time) and end (maximum time).
For example, consider emp_id 879362, On 28/10/2023 he is starting his work from 09:00 and ends his day by 18:00 so i just need start time and end time of every employee.
Output should be like:
Emp_Id | Date | Start Time | End time. |
879362 | 28/10/2023 | 09:00 | 18:00 |
626866 | 28/10/2023 | 10:00 | 14:00 |
Kindly attach the photos with logics as I can't access Alteryx application as of now so it would be great help if someone provides the snip with all logic.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@kapilthakur use the summarise tool
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@kapilthakur
Just trying another approach.
We can first sort the data by Employee iD and Interval time then use Sample Tool to pick up the first and last row for each Empoylee iD, which are the Start and End time then use a Join tool to bring the data back together.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you @binuacs
![](/skins/images/18F3BF3EB54AD3C2739B5AA9B77A7F97/responsive_peak/images/icon_anonymous_message.png)