Oct 03, 2020 02:50 PM
Hi everyone
I have a habit/task table, the time period is on a multiple choice column (daily, weekly, bi-weekly monthly, etc.). I keep track of the last time it’s done (the date).
Is there a formula that can take both into consideration and tell me if something is overdue?
for example if it has been more then a week since i did a weekly task.
Oct 03, 2020 08:11 PM
A formula field with a switch statement should work well for this. I created an example base with this formula that calculates a “due date” for each case:
SWITCH(
Frequency,
'Daily',DATEADD({Last Completed},1,'day'),
'Weekly',DATEADD({Last Completed},1,'week'),
'Biweekly',DATEADD({Last Completed},2,'week'),
'Annually',DATEADD({Last Completed},1,'year')
)
“Frequency” is the field where you will select the time period of the task. Each case adds the correct time period. Then you can create a second field that compares the “due date” against the current day:
IF(TODAY()>{Due Date},"Yes","No")
Oct 04, 2020 03:53 AM
The due date thing doesn’t work
Oct 04, 2020 09:55 AM
Try clicking on the example base that I linked to and look at how it’s set up. Does the column naming in your base match the column naming in the example?
Oct 04, 2020 02:38 PM
It doesn’t, i changed the names accordingly but it doesn’t work, it says something is wrong but i don’t see what
Oct 04, 2020 06:39 PM
Can you upload a screenshot of the code?
Oct 07, 2020 04:50 AM
Oct 07, 2020 06:38 AM
It looks like the brackets with punctuation in front of each case may be your issue. What is the purpose of that? If you paste the code here, I’ll make a couple edits for you
Oct 07, 2020 06:56 AM
SWITCH({time frame (from full contact list)},{.}‘daily’,DATEADD({Last Catch-up},1,‘day’),{.}‘twice a week’,DATEADD({Last Catch-up},3,‘day’),{.}‘weekly’,DATEADD({Last Catch-up},1,‘week’),{.}‘bi-weekly’,DATEADD({Last Catch-up},2,‘week’),{.}‘monthly’,DATEADD({Last Catch-up},1,‘month’),{.}‘6 months’,DATEADD({Last Catch-up},6,‘month’))
they don’t have a purpose it’s just what the computer gave me when i tried changing things.
thank you for your help.
Oct 07, 2020 07:08 AM
Try this:
SWITCH(
{time frame (from full contact list)},
'daily', DATEADD({Last Catch-up},1,'day'),
'twice a week',DATEADD({Last Catch-up},3,'day'),
'weekly',DATEADD({Last Catch-up},1,'week'),
'bi-weekly',DATEADD({Last Catch-up},2,'week'),
'monthly',DATEADD({Last Catch-up},1,'month'),
'6 months',DATEADD({Last Catch-up},6,'month')
)