Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Mar 15, 2023 05:27 PM
I am trying to build a base for a company that delivers natural food for pets. The clients tells us the date they want their first delivery made, how often they want to receive it (every week, every 2 weeks, etc), the preferred day of the week they want to receive the deliveries (monday, tuesday, etc) and also the number of deliveries that are already paid for.
Based on that I would like the base to automatically fill the future delivery dates for each client record considering the informations we have. This will be importante so that I can set up a calendar view later that will allow me to know all the clients I have to make deliveries on any specific date.
Thanks in advance for any help and I am sorry if this is not the right place to ask.
Solved! Go to Solution.
Mar 16, 2023 02:32 PM
Hi @tsallis,
This is an interesting problem!
Typically went I solve more complex problems like this I break out the formula into tangible steps in different fields, which helps me keep track of solving the issue. I will share my process as I think it will be helpful. For reference this base is going off of assumption of today being March 16th 2023.
Below is a screenshot of my base
The first step is to quantify the preferred day of the week to a number that we can use in computations. The weekday( ) function in airtable tells us the day of the week from 0-6 (0 = sunday, and 6=saturday), and we will utilize this function to calculate the next deliveries.
I called this field "Preferred day of the week #" and used this formula to match the weekday( ) function in Airtable:
Next, I want to calculate the date of the second delivery as this delivery will be on the clients preferred date. I called this formula "2nd Delivery", and the formula to do this is as follows:
Mar 16, 2023 02:32 PM
Hi @tsallis,
This is an interesting problem!
Typically went I solve more complex problems like this I break out the formula into tangible steps in different fields, which helps me keep track of solving the issue. I will share my process as I think it will be helpful. For reference this base is going off of assumption of today being March 16th 2023.
Below is a screenshot of my base
The first step is to quantify the preferred day of the week to a number that we can use in computations. The weekday( ) function in airtable tells us the day of the week from 0-6 (0 = sunday, and 6=saturday), and we will utilize this function to calculate the next deliveries.
I called this field "Preferred day of the week #" and used this formula to match the weekday( ) function in Airtable:
Next, I want to calculate the date of the second delivery as this delivery will be on the clients preferred date. I called this formula "2nd Delivery", and the formula to do this is as follows:
Mar 16, 2023 06:07 PM
Hi Cherry, I am so happy to be in such a great community with people like you. It worked like a charm, thanks a lot for the perfect explanation! Just the final part about updating the paid deliveries field with the automation I could not do.
Also, since some clients pay for annual plans with weekly deliveries, it would be great to have some automation that fills all the future dates
Thanks again and if you ever came to Rio de Janeiro let me know and the coconut water will be on me 🙂