Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI
Can someone please help me with below requirement Logic and function to be used.
I need to filter by JOB and Task with start and end time for JO and event respectively.
Log Table:
date | time | Event |
15-07-2019 | 1.00 Am | Job Start:Turning |
15-07-2019 | 2.00 Am | Task Start: Turning Componrnt 1 load tool |
15-07-2019 | 2.30 Am | tool loaded |
15-07-2019 | 2.40 Am | Machining |
15-07-2019 | 3.00 Am | Task End: Turning Componrnt 1 load tool |
15-07-2019 | 3.30 Am | Task Start: Turning Componrnt 2 load tool |
15-07-2019 | 4.00 Am | tool loaded |
15-07-2019 | 5.00 Am | Machining |
15-07-2019 | 5.15 Am | Task End:Turning Componrnt 2 load tool |
15-07-2019 | 5.55 Am | Job End: Turning |
15-07-2019 | 6.12 Am | Job Start:Milling |
15-07-2019 | 6.30 Am | Task Start: Milling Componrnt 1 load tool |
15-07-2019 | 7.00 Am | tool loaded |
15-07-2019 | 7.20 Am | Machining |
15-07-2019 | 7.25 Am | Task End:Milling Componrnt 1 load tool |
15-07-2019 | 7.40 Am | Task Start: Milling Componrnt 2 load tool |
15-07-2019 | 7.50 Am | tool loaded |
15-07-2019 | 8.05 Am | Machining |
15-07-2019 | 8.15 Am | Task End: Milling Componrnt 2 load tool |
15-07-2019 | 8.18 Am | Job End: Milling |
15-07-2019 | 8.30 Am | Job Start :Cleaning |
15-07-2019 | 8.35 AM | Task Start: CleaningComponrnt 2 load tool |
15-07-2019 | 8.40 Am | tool loaded |
15-07-2019 | 8.45 Am | Cleaning |
15-07-2019 | 8.45 Am | Task End: CleaningComponrnt 2 load tool |
15-07-2019 | 8.45 Am | Job End:Cleaning |
I need to get table similar so that i can filter in the front end by Job and Task
date | time | Event | JOB | Start Time | End Time |
15-07-2019 | 1.00 Am | Job Start:Turning | Turning | 1.00 Am | 5.55 Am |
15-07-2019 | 2.00 Am | Task Start: Turning Componrnt 1 load tool | Turning | 1.00 Am | 5.55 Am |
15-07-2019 | 2.30 Am | tool loaded | Turning | 1.00 Am | 5.55 Am |
15-07-2019 | 2.40 Am | Machining | Turning | 1.00 Am | 5.55 Am |
15-07-2019 | 3.00 Am | Task End: Turning Componrnt 1 load tool | Turning | 1.00 Am | 5.55 Am |
15-07-2019 | 3.30 Am | Task Start: Turning Componrnt 2 load tool | Turning | 1.00 Am | 5.55 Am |
15-07-2019 | 4.00 Am | tool loaded | Turning | 1.00 Am | 5.55 Am |
15-07-2019 | 5.00 Am | Machining | Turning | 1.00 Am | 5.55 Am |
15-07-2019 | 5.15 Am | Task End:Turning Componrnt 2 load tool | Turning | 1.00 Am | 5.55 Am |
15-07-2019 | 5.55 Am | Job End: Turning | Turning | 1.00 Am | 5.55 Am |
15-07-2019 | 6.12 Am | Job Start:Milling | Milling | 6.12 Am | 8.18 Am |
15-07-2019 | 6.30 Am | Task Start: Milling Componrnt 1 load tool | Milling | 6.12 Am | 8.18 Am |
15-07-2019 | 7.00 Am | tool loaded | Milling | 6.12 Am | 8.18 Am |
15-07-2019 | 7.20 Am | Machining | Milling | 6.12 Am | 8.18 Am |
15-07-2019 | 7.25 Am | Task End:Milling Componrnt 1 load tool | Milling | 6.12 Am | 8.18 Am |
15-07-2019 | 7.40 Am | Task Start: Milling Componrnt 2 load tool | Milling | 6.12 Am | 8.18 Am |
15-07-2019 | 7.50 Am | tool loaded | Milling | 6.12 Am | 8.18 Am |
15-07-2019 | 8.05 Am | Machining | Milling | 6.12 Am | 8.18 Am |
15-07-2019 | 8.15 Am | Task End: Milling Componrnt 2 load tool | Milling | 6.12 Am | 8.18 Am |
15-07-2019 | 8.18 Am | Job End: Milling | Milling | 6.12 Am | 8.18 Am |
15-07-2019 | 8.30 Am | Job Start :Cleaning | Cleaning | 8.30 Am | 8.45 Am |
15-07-2019 | 8.35 AM | Task Start: CleaningComponrnt 2 load tool | Cleaning | 8.30 Am | 8.45 Am |
15-07-2019 | 8.40 Am | tool loaded | Cleaning | 8.30 Am | 8.45 Am |
15-07-2019 | 8.45 Am | Cleaning | Cleaning | 8.30 Am | 8.45 Am |
15-07-2019 | 8.45 Am | Task End: CleaningComponrnt 2 load tool | Cleaning | 8.30 Am | 8.45 Am |
15-07-2019 | 8.45 Am | Job End:Cleaning | Cleaning | 8.30 Am | 8.45 Am |
Have you tried calculating start and end time during the data load? Assuming only one JOB runs at a time...
Hi ,
I would say do group by Job and take MinDate(with timestamp ) as Start date and MaxDate(with timestamp) as EndDate, and take start time from start date and End time from EndDate
Thank you for the reply.
Grouped the job using Row num and Peek function , made a different table for end time and it worked got helped by Petter in the community.