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.
Solved! Go to Solution.
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
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.
Hi @Tyro_abc
I found cases, where duration is not calculated correctly.
For order number 5 should be 30 min and not 60.
Best regards,
Boštjan
@Ahacibo
This is my try.
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 |
1 | 17.01.2021 | 18:00:00 | 0/00:30:00 |
Best regards,
Boštjan
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 🙂 😁