So to recap, you have:
rate 1 : mo-fr, first 8 h, 100 %
rate 2 : mo-fr, >8h; 133%
rate 3 : sat, 150%
rate 4 : sun, 200%
You would like to know how much hours of every rate a person totalizes per given day or week, moth etc.
If yes, I would solve it like this:
Assuming you have:
- 1 field called total hours that returns the total hours worked on a given day
- one called day wich is returning the day number
- you're calculating on a per day basis.
rate 1 = total hours if not greater then 8 and weekday not greater than 5
rate 2 = if total hours is bigger then 8 and weekday not greater than 5, total hours - 8
rate 3 = if weekday = 6 ; total hours
rate 4 = if weekday = 7 ; total hours
Use the if() or case() functions.
If you don't have the fields like stated above, you can use variables with the let() function.
I can't tell if it's the best or easiest way but it's probably how i would do it.
1 of 1 people found this helpful
Hi Jonas Gysin,
Thanks for your quick response.
Would the calculation be
if total hours > 8
if total hours > 8 < 5 = total hours - 8
Is this right?
also should rate 3 and 4 be
if weekend = 6;total hours??
Can you right the calculation out so I know I'm not being stupid!! haha
Haha thanks very much Jonas I'm useless at If commands #stilllearning
Give it a try, read the few pages of the help file I linked, everything is there.
You can test your code directly in FM. Worst case : It doesn't work.
If you're stuck, post back here. If you manage it, you won't be useless at it anymore!
I tried this and it didn't work.
Ok well can you post the commands you wrote? We'll see from there.