Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
CNC-Reporter
New Member

Grouping Programms until another Programm starts

I hope the Title is somewhat correct, I have searched the Forums and Google, but didnt really know what the correct terms are for what i want to achieve.

 

I have set up a report database for our CNC-Machine monitoring tool, these machines run lengthy programms with a lot of stops in between for manual Inspection or other technological breaks which are unavoidable, therefore the same Programm can have widely different run times based on the machinist, logistical situation and a lot of adjacent factors between parts.

 

The data i recieve looks something like this:

programidprogram_start     program_end       program_state
PGM1126.09.2023 04:3126.09.2023 09:43COMPLETED
PGM2226.09.2023 07:5126.09.2023 07:57COMPLETED
PGM2326.09.2023 10:0826.09.2023 11:07COMPLETED
PGM1426.09.2023 10:0826.09.2023 11:07COMPLETED
PGM2526.09.2023 11:0726.09.2023 11:22COMPLETED
PGM3626.09.2023 11:0726.09.2023 16:09COMPLETED
PGM2726.09.2023 14:1726.09.2023 14:25COMPLETED
PGM2826.09.2023 16:0926.09.2023 17:31COMPLETED
PGM3926.09.2023 16:0926.09.2023 22:23COMPLETED
PGM21026.09.2023 20:5026.09.2023 20:56COMPLETED
PGM21126.09.2023 22:2426.09.2023 22:39CANCELED_BY_USER
PGM31226.09.2023 22:2426.09.2023 22:39CANCELED_BY_USER
PGM21326.09.2023 22:3926.09.2023 23:08COMPLETED
PGM31426.09.2023 22:3926.09.2023 23:08COMPLETED
PGM21526.09.2023 23:0826.09.2023 23:10COMPLETED
PGM11626.09.2023 23:0826.09.2023 23:24CANCELED_BY_USER
PGM21726.09.2023 23:1026.09.2023 23:24COMPLETED
PGM11826.09.2023 23:2527.09.2023 05:25COMPLETED
PGM21927.09.2023 03:3127.09.2023 03:38COMPLETED
PGM22027.09.2023 05:3127.09.2023 05:53CANCELED_BY_USER
PGM12127.09.2023 05:3127.09.2023 05:53CANCELED_BY_USER
PGM22227.09.2023 07:1227.09.2023 08:48COMPLETED
PGM12327.09.2023 07:1227.09.2023 08:48COMPLETED
PGM42427.09.2023 08:4827.09.2023 10:21CANCELED_BY_USER
PGM42527.09.2023 10:2327.09.2023 10:23CANCELED_BY_USER
PGM42627.09.2023 10:2327.09.2023 10:46CANCELED_BY_USER
PGM42727.09.2023 10:4627.09.2023 10:47CANCELED_BY_USER
PGM42827.09.2023 10:4727.09.2023 12:46CANCELED_BY_USER
PGM22927.09.2023 12:3327.09.2023 12:39COMPLETED
PGM43027.09.2023 12:4727.09.2023 12:51CANCELED_BY_USER
PGM43127.09.2023 12:5227.09.2023 13:01CANCELED_BY_USER
PGM43227.09.2023 13:0127.09.2023 14:01CANCELED_BY_USER
PGM43327.09.2023 14:0227.09.2023 16:31CANCELED_BY_USER
PGM43427.09.2023 16:3327.09.2023 20:06COMPLETED
PGM23527.09.2023 20:1827.09.2023 21:38COMPLETED
PGM43627.09.2023 20:1828.09.2023 01:44CANCELED_BY_USER
PGM43728.09.2023 01:4428.09.2023 01:53CANCELED_BY_USER
PGM43828.09.2023 01:5328.09.2023 02:17CANCELED_BY_USER
PGM43928.09.2023 02:1728.09.2023 04:30CANCELED_BY_USER
PGM44028.09.2023 04:3128.09.2023 05:40CANCELED_BY_USER
PGM44128.09.2023 05:4128.09.2023 05:58COMPLETED
PGM24228.09.2023 06:28 RUNNING
PGM44328.09.2023 06:28 RUNNING

 

What i need is to group these uncompleted programms together to get some resemblence of one coherent programm, which is somewhat beyond my capabilities.

Ideally it would look something like this:

 

programidprogram_startprogram_endprogram_state
PGM1126.09.2023 04:3126.09.2023 09:43COMPLETED
PGM2226.09.2023 07:5126.09.2023 11:07COMPLETED
PGM1426.09.2023 10:0826.09.2023 11:07COMPLETED
PGM2526.09.2023 11:0726.09.2023 11:22COMPLETED
PGM3626.09.2023 11:0726.09.2023 16:09COMPLETED
PGM2726.09.2023 14:1726.09.2023 17:31COMPLETED
PGM3926.09.2023 16:0926.09.2023 22:23COMPLETED
PGM21026.09.2023 20:5026.09.2023 22:39COMPLETED
PGM31226.09.2023 22:2426.09.2023 22:39CANCELED_BY_USER
PGM21326.09.2023 22:3926.09.2023 23:08COMPLETED
PGM31426.09.2023 22:3926.09.2023 23:08COMPLETED
PGM21526.09.2023 23:0826.09.2023 23:10COMPLETED
PGM11626.09.2023 23:0826.09.2023 23:24CANCELED_BY_USER
PGM21726.09.2023 23:1026.09.2023 23:24COMPLETED
PGM11826.09.2023 23:2527.09.2023 05:25COMPLETED
PGM21927.09.2023 03:3127.09.2023 05:53COMPLETED
PGM22027.09.2023 05:3127.09.2023 05:53CANCELED_BY_USER
PGM12127.09.2023 05:3127.09.2023 05:53CANCELED_BY_USER
PGM22227.09.2023 07:1227.09.2023 08:48COMPLETED
PGM12327.09.2023 07:1227.09.2023 08:48COMPLETED
PGM42427.09.2023 08:4827.09.2023 12:46COMPLETED
PGM22927.09.2023 12:3327.09.2023 12:39COMPLETED
PGM43027.09.2023 12:4727.09.2023 20:06COMPLETED
PGM23527.09.2023 20:1827.09.2023 21:38COMPLETED
PGM43627.09.2023 20:1828.09.2023 05:58COMPLETED

 

The red ones are grouped, so that the end time comes from the last occurence of said programm which are in one "block" (rows right below each other).

the program_state sadly is just an indicator for the real status, which means even if it states "CANCELED_BY_USER" it may have been completed, just the last NC-Step was not completely run to its end. In the same Fashion it is possible that the "COMPLETED" status may not entirely be true, if the machinist skipped some part of the code for some reasen, finished the programm and ran the skipped part afterwards, e.g. some tool was unavailable and needed to be changed, which may take some time.

The "id" column is actually some lengthy Hashcode i think, but i can obviously get this result in PowerQuery.

 

I could do this with Excel and VBA, but i would like to keep everything in database form for cleaner and easier access.

 

I am sorry if my grammar or wording seems weird, i am a native german speaker but try my best.

 

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

I understand the reason why the rows of ID3 and ID2 have been subsumed into one (same program_end date and time).  But why (on what logic) have rows 7 and 8 (and other rows) been subsumed into 1.

Even when solving this in MS Excel, what would the Excel formula logic have been?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

The rows 7 and 8 fullfill my criteria for subsuming by:
1. being the same PGM
2. occuring right after each other

 

The same goes for id 24 to 28. Its all the same PGM and without being interrupted by anything else i would like them Grouped so they appear as one.

 

I hope this helps you help me.

 

You could say they were done together.

lbendlin
Super User
Super User

Very confusing.  Let's see if a graphical representation can help me understand what you need?

lbendlin_0-1696037885940.png

 

That's an error on my part.

PGM2 can be ignored in the real Report, because its a SubProgram. The Monitor lists both and so it appears as if multiple programs are running at the same time.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.