Jun 08, 2020 06:47 AM
What would be the correct way to have the duration / age of a ticket in Airtable being any status that isn’t “Complete”?
In the “Days Open” field I currently have got to this formula :
IF(LAST_MODIFIED_TIME(Status), WORKDAY_DIFF( TODAY(), LAST_MODIFIED_TIME({Status}) ) )
What’s the best way to stop it counting once the ticket is completed?
Solved! Go to Solution.
Jun 08, 2020 08:08 AM
OK, so there’s a couple of things there that don’t look right:
WORKDAY_DIFF({Created Date}, TODAY())
You should find this will give you positive numbers for the number of days.
IF({Status} != 'Complete', WORKDAY_DIFF({Created Date}, TODAY()))
You can’t do this, I’m afraid:
LAST_MODIFIED_TIME(Status) != “Complete”,
Jun 08, 2020 07:05 AM
Hi @Nikesh_Ashar - I’m not sure what your process is, but I think you might want to make the days open calculation based on “created date” rather than a last modified time. I’m guessing that the status might get updated multiple times and as it stands your formula would work off the last update to the current status (which might not be the “origin” status).
But…to answer your specific question you can do something like this:
IF(AND({Status} != 'Complete', YOUR_DATE_FIELD), WORKDAY_DIFF(...))
So this is saying:
If the status is not ‘Complete’ AND you have a date field, then do the workday diff calc
Jun 08, 2020 07:21 AM
Good point @JonathanBowen
I’ll update the formula to include created date. Will it automatically ignore the time?
Jun 08, 2020 07:27 AM
You can set it so that time is not included in the value:
But, yes, WORKDAY_DIFF looks like it ignores any time value.
Jun 08, 2020 07:35 AM
I’ve now got to this formula :
IF(LAST_MODIFIED_TIME(Status) != “Complete”, WORKDAY_DIFF( TODAY(), CREATED_TIME({Date created})) )
It doesn’t seem to have changed anything and still giving me negative values in the cells.
Jun 08, 2020 08:08 AM
OK, so there’s a couple of things there that don’t look right:
WORKDAY_DIFF({Created Date}, TODAY())
You should find this will give you positive numbers for the number of days.
IF({Status} != 'Complete', WORKDAY_DIFF({Created Date}, TODAY()))
You can’t do this, I’m afraid:
LAST_MODIFIED_TIME(Status) != “Complete”,
Jun 16, 2020 07:34 PM
@Nikesh_Ashar Were the suggestions from @JonathanBowen able to solve your problem? If so, please mark his latest comment as the solution. If you still need assistance, let us know!
Jun 17, 2020 02:16 AM
Done - thank you. Still getting used to this platform