Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Converting production run durations to by-day schedule

scottconstance
5 - Atom

Hello Alteryx community,

 

I have some data describing the length of production runs on a production line.  So one column specifies the line, the second column specifies the completion date of the production run, and the third column specifies the length in days of the production run.

 

I need to convert this into a by-day schedule of when the line was run.  So one column would specify the line just like before, but the second column would specify a single day, and the third column would specify the proportion of the day that the line was run (i.e., maximum = 1).

 

I've attached an xls illustrating the data I have to start with and what I'd like to end with.  I feel like the Generate Rows tool should work but I can't get it to work quite right.

 

Thank you for reading and for any help you can provide.

17 REPLIES 17
Ahacibo
6 - Meteoroid

Hi @Tyro_abc 

 

I just saw, that I did not correct every thing for "hours" interval calculation. Original flow is on "minutes".

 

Regard,

Boštjan

Tyro_abc
11 - Bolide

If you use total hours ( as duration)  and datetimeadd function to generate the hours, it might be easier.  It would also take care of change of dates like your order number 16.

Ahacibo
6 - Meteoroid

Hi @Tyro_abc 

 

I found cases, where duration is not calculated correctly.

For order number 5 should be 30 min and not 60.

 

Ahacibo_0-1610972488074.png

 

Best regards,

Boštjan

Qiu
20 - Arcturus
20 - Arcturus

@Ahacibo 
This is my try.

0118-Ahacibo.PNG

Ahacibo
6 - Meteoroid

@Qiu 

 

Thank you for your version.

 

I will check flow with worse case.

 

Best regards,

Boštjan

Ahacibo
6 - Meteoroid

Hi @Qiu 

 

I found cases, where duration is not calculated correctly and for order number 1 I get two records (it should be only one), and one have wrong duration. Correct is 30min.

 
Order Number Star Date Start time Duration
117.01.2021 18:00:00 0/00:30:00

 

 

1.jpg

 

Best regards,

Boštjan

 
 
 

 

 

 

 

Ahacibo
6 - Meteoroid

Hi @Qiu and @Tyro_abc 

 

Because the time is per second accurate and because I have to include all the dates in the flow, even when production is not going on, I made flow like this.

I reduce numbers of rows in why that I sum over Clokck 15min.

 

1.jpg

2.jpg

Thanks to both for the ideas and

Best regards,

Boštjan

 

 

Tyro_abc
11 - Bolide

I saw the issue is coming from formula below, we need to add another condition to check if  the total time spent is less than 1 hour.

Basically if the start time hour and end time hours are same and total duration is less than an hour, then we need to take the difference of two times.

 

But as you already  have a working flow, I am not taking any more pain 🙂 😁

 

arundhuti726_0-1611005523731.png

 

Labels