Hi @Luong_Do,
If you have a separate table for your customers (where they are listed), then you could use a rollup to get min and max dates, which would give you the data range.
If you don’t use a separate table for customers, you could use the summary blocks in apps, to get min a max dates. If you want to parse it out by different customers, you may want to consider setting up a filtered view. This would be a good option if you just need the ranges occasionally but not for regular reporting.
The third option would be using a script to get min and max dates.
Thanks,
Chris
Welcome to the Airtable community!
Using rollups as suggested by Williams_Innovations will only work if there are exactly two orders. If there are multiple orders, you will not be able to see the interval between the orders.
The screenshot is not showing up in the forums, but I’m guessing that you have an nOrders] table where each order is a record.
You can have a same-table linked record field to link to the previous record. Then use a rollup field to get the date of the previous order. Finally, have a formula field calculate the date range using DATETIME_DIFF
. (It is possible to do this all in a rollup field, but the formula gets complex because of how dates are handled in rollup fields.)
If you have a aCustomers] table, it is possible to automate the creation of the link to the previous record. The automation would require either access to the beta for conditional logic in automations, or a automation script.