Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I want to make a calculation that I need help with.  I want filemaker to tell me how many days a work order has been late.  For instance when we make a work order we give it 7 business days till due.  I would like filemaker to tell me how many days its past due if the order is still open.  What would the calculation be?

Posted

//something like

Let (

[

_status = Status Flag ;

_due = 7 ;

_overdue_days = ( date + _due ) - date

];

If ( _status = "open" ; _overdue_days ; "" )

)

Posted

Why not

Let ( due = workorderDate + 7 ;
Case ( status = "Open" ; Get ( CurrentDate ) - due )
)

HTH

calculation must be set to unstored in options also because you are using the current date so it must change constantly or at least when viewed.

Posted

Why not

Let ( due = workorderDate + 7 ;
Case ( status = "Open" ; Get ( CurrentDate ) - due )
)

Why not calculate anything only if the status is open?

Case ( 
  statusField = "open" ;
  Get ( CurrentDate ) - workorderCreation + 7 
)

Posted

For instance when we make a work order we give it 7 business days till due.

You need to tell us what counts as a "business day" in your business: weekdays, holidays, etc.

Posted (edited)

I want filemaker to tell me how many days a work order has been late.  For instance when we make a work order we give it 7 business days till due.  I would like filemaker to tell me how many days its past due if the order is still open. 

You need to start by calculating how many business days are there between the date of the order and today - which is not trivial at all. Then compare this with the number of business days allowed for the order.

The following fields are assumed:

  • OrderDate (Date)
  • DueDays (Number)
  • DeliveredDate (Date)
Let ( [ 
workStart = OrderDate + Choose ( Mod ( OrderDate - 1 ; 7 ) - 5 ; 2 ; 1 ) ;
n = Get ( CurrentDate ) - workStart ; 
w = Div ( n ; 7 ) ; 
r = Mod ( n ; 7 ) ; 
d = Mod ( workStart - 1 ; 7 ) ; 
a = ( d + r > 5 ) + ( d + r > 6 ) ;
workdays = 5 * w + r - a ;
overdue = workdays - DueDays
] ;
Case ( overdue > 0 and not DeliveredDate ; overdue )
)

Note:
I believe this has come up in another question of yours: you should record the closure of a project by entering a date into a date field (in this example, the DeliveryDate field). Once you have done that, the status of the project is given by the existence of the date in this field, and an additional Status field is unnecessary.

 

 

Edited by comment

This topic is 3463 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.