Jump to content

If a calculation field results in a negative it is not used in another calculation field


This topic is 2443 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi

 

 I have a timesheet database and sometimes the post call field might result in a negative result. This however means that the Total overtime field will take it off the calculation as it includes the result of 4 fields. Is there a way to make it so the total calculation field doesn't include the post field if it is a negative. In the file attached you can see that the overtime should calculate 6 and half hours (pre, camera and broken added together are 6.5 hrs but it is taking 30 mins off cos the post is a negative .

 

The post is a negative because it is taking the time from the wrap out time to the leave time less 45 mins we give free. But when you add in the camera overtime  in this instance it thinks it is a negative 30 mins cos it is less then the free 45 mins we give.

 

Is what I am asking possible? I tried adding something like this to the post field at the end of the calculation

 Let( [ MyCalcResult = Post Call ]; Max(MyCalcResult;0) )

but then it stopped calculating and also then in turn stopped the total overtime from working

username is admin and password is pirates.

 

thanks

Sarah 

 

 

 

Edited by littlered136
Link to comment
Share on other sites

Would this work for you:

Let ( 
postcall = Leave - timesheets::wrap - ( Camera + 2700 ) 
; 
If (
Leave and postcall > 0 ; Ceiling ( postcall / 1800 ) * 1800 
)
)

Note: you must be careful not to name your variables with a name already used as a field name - otherwise you might get unexpected results.

 

  • Like 1
Link to comment
Share on other sites

This topic is 2443 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.