Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here
SOLVED

doing an Hours Conversion formula

Highlighted
7 - Meteor

So I'm sure there is an easy answer to this but I've been trying to rack my brain to figure it out.  I'm doing a basic hours formula by count.  However I would like to calculate this down to the day without effecting the previous months.  So example: if we are in Feb 15, 2019 how can we calculate that without effecting January's Hours Worked?  Is there formula that I can apply without having to update on a  regular basis?  I attached the workflow.

 

COrr_0-1579038686635.png

 

 

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hello @COrr ,

 

I am not sure if I am getting right what you are looking for. If you are trying to do an acumulative calculation by month you could use the running total tool.

 

It lets you group the data by the selected fields.

 

Is this what you want? If not, could you please explain it with a quick example?

 

Regards

Highlighted
17 - Castor
17 - Castor

Hi @COrr 

 

If your looking for a cumulative total of the hours worked in a specific month for each day, you can calculate it using like this

 

w.png

 

Start by calculating the start date for the month and the number of days in that month.  Generate all the days for each month in your input.  Then calculate the hours worked to this date using the following formula

(DateTimeDiff([Date],[StartDate],"days")+1)/[DaysInMonth] * [Count]*[Hours Scheduled]

This calculates the percentage that the current date is of the number of days in that month and mulitples this percentage by the total work for the entire month.

 

The results look like this 

 

r.png

 

This assumes that someone works every day in the month.  If you need to include only business days the check the solution to this post for a way to do that.   

 

Dan

 

Labels