Home      Ask a Question      My Stuff      Help   
  
TimeWorks Plus - Average Hours Calculation
This is for averaging the hours worked per day to determine auto hours and is set to expire and re calculate every 30 days.

This process requires one to have "Holiday Rule" enabled as well as Accruals.

--Below is set by creating two buckets in Accruals called "Days" and "Hours" for the daily average calculation.

AccrueUpScript top box:
if(reportingdate.isholiday and ishours){
hours = getbalance("Hours") / getbalance("Days");
if(hours > 8){
hours = 8;
}
}
AccrueUpScript bottom box:
if(reportingdate.totalhoursot > 0){
accrueup("Days", 1, "", "", reportingdate.date + 30);
accrueup("Hours", reportingdate.totalhoursot, "", "", reportingdate.date + 30);
}



--If you would like to determine the average hours worked in the week for the last 6 months you would do the following. In this example we are using Accruals buckets called "Weeks" and "Week Hours" to do the weekly average calculations:

AccrueUpScript bottom box:

if(reportingdate.date = reportingdate.workweekend){
accrueup("Weeks", 1, "", "", reportingdate.date + 180);
accrueup("Week Hours", reportingdate.weekhours, "", "", reportingdate.date + 180);
}

addalert(getbalance("Weeks Hours")/getbalance("Weeks"));

As we are doing this for 6 months this comes out to 180 as seen in the above script. This can be adjusted by adjusting the amount of days in the scripting for example 3 months would be 90 days.

ID
1661
Category
>Support
  Accruals
Date Created
9/16/2015 12:37:34 PM
Date Updated
9/22/2015 10:02:48 AM
Back to Search Results