Alteryx Designer Desktop Discussions

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

Split X hours across a time period

Guglielmo91
6 - Meteoroid

Hi there,

 

I need your help. I need to spread a certain work time across a certain time frame. For example:

 

OrderWorkcenterWorktime [hr]Data d'inizio programmataData di fine programmata
2312946177137324015/02/202217/04/2022
2312......1.....50......................

 

I would like to split the order 2312946 from 15/02/2022 to 17/04/2022 by taking in to account the weight of the single days and the months leght. 

 

the goal is to map the workload given by a certain number of orders across the facilty splitted on several workcenters. This must take in to account the weight on the different months and years in order to obtain a chart like this:

 

Guglielmo91_0-1648461600522.png

 

can you help me?

 

thanks 

 

Guglielmo 

 

 

 

3 REPLIES 3
kelly_gilbert
13 - Pulsar

Hi, @Guglielmo91 - if I'm understanding correctly, you want to take the 40 hours in the first row, and then divide that evenly across the number of days between 15/02/2022 and 17/04/2022?

Here's a similar question that might help you get started: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/split-time-period-into-rows/m-p/802493...

 

  • In your case, you can use a Generate Rows tool to split each line into one row per day
    (in your case, the Loop Expression would be datetimeadd([date], 1, 'day') to increment one day at a time)

  • Then, use a Formula tool to calculate the hours per day = [Worktime (hr)] / (DateTimeDiff([end date], [begin date], 'day') + 1)

  • Finally, use a Summarize tool to sum by category and day.
allwynthomas24
11 - Bolide

Hey @Guglielmo91,

 

Yesterday another community member had posted the same query with the same data. So try this attached workflow and confirm whether it matches your requirement. For workflow explanation please refer reply given by @kelly_gilbert.

Thanks & Regards.

 

Spoiler
allwynthomas24_1-1648530248829.png
JarekSkudrzyk
11 - Bolide

@Guglielmo91 

hi,

if the solutions by @allwynthomas24 and @kelly_gilbert are not what you were looking for - could you please elaborate on the concept of "the weight on the different months and years"?
Is it what @kelly_gilbert mentioned - that the working hours are spread evenly from start date to end date?

Labels