[Last Call] Learn how to a build a cloud-first strategyRegister Now


filemaker script with overtime and calcuration

Posted on 2007-08-07
Medium Priority
Last Modified: 2010-04-27
do you know how to make this script?

40 hours max per week regular work hour and if it get more, it becomes overtime.
lunch hour deduct from overtime first and if there is no overtime, deduct from regular time.
i can't figure out how to make lunch hour deduction "if script" like this case;

if overtime is 3 hour and lunch time is 4 hour, they deduct 3 hours from overtime and 1hour from regular time..

please help me.
Question by:Hiroyuki Tamura
  • 2
  • 2

Expert Comment

ID: 19662366
I am going to assume that overtime is 1.5 times regular time so that if you work 41 hours in a week you actually get paid for 41.5 hours.  I am also going to assume that you need to calculate the number of hours that a person will be paid for before subtracting the lunch time. If this is the case you can do the following:

Create 2 number fields, HoursWorked and LunchTime

Make a Calculation field called CalcHoursWorked which results in a number:

CalcHoursWorked =
RegTime = If(HoursWorked>40;40;HoursWorked);
Overtime = If(HoursWorked>40;HoursWorked-40;0);
CalcTotalTime = regTime +Overtime*1.5

Make 2 fields called StraightTime and OverTime which are calculations that results in numbers:

StraightTime = If(CalcHoursWorked>40;40;CalcHoursWorked)

Overtime = If(CalcHoursWorked>40;CalcHoursWorked-40;0)

If you do not have to calculate the effictive hours that a person has to be paid for before subtracting the lunch, you can just subtract the lunch from the hours worked instead of going through all these steps but I don't think that is what you were asking.

Author Comment

by:Hiroyuki Tamura
ID: 19663132
thank you, JoJohn2004!

i have some problem;

case 1
HoursWorked: 60hours, Lunch 4 Hours

Regular 40hours, Overtime 20hours - Lunch 4 Hours = CalcOvertime 16hours

case 2
HoursWorked: 44hours, Lunch 4 Hours

Regular 40hours, Overtime 4hours - Lunch 4 Hours = CalcOvertime 0hours

case 3
HoursWorked: 43hours, Lunch 4 Hours

Regular 40hours, Overtime 3hours - Lunch 4 Hours = CalcOvertime 0hours (even -1 hours)
CalcRegular 39hours (they deduct from regular)

it's little weird but they deduct from overtime and Lunchtime same unit...

Accepted Solution

JoJohn2004 earned 500 total points
ID: 19666946
If they are deducting as the same unit you don't have to do anything to the data. Add up the total number of hours and subtract lunch then calculate how much time is over 40 for the overtime.

Author Comment

by:Hiroyuki Tamura
ID: 19771486
thank u

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question