I have a `rollup` column, `A` that returns a `date`. for example, 2024-07-24.
I have a `lookup` column, `B`, that returns an array of dates. For example, 2018-07-31, 2021-07-30, 2024-10-08
Is there a way to determines if any of the dates in column `B` are within 30 days (before or after) of the date in column `A`? I need the formula to return a boolean.
Page 1 / 1
Try switching your column B to a rollup, and set it to MIN() instead of the default ARRAYUNIQUE() so it returns the earliest date amongst the original values.
Duplicate it (column C) and do MAX() now instead, for latest date.
You should then just be able to fashion your logic check with IF(), OR(), and DATETIME_DIFF() on these three columns (if A is less than 30 days prior to B or A is less than 30 days after C).
Hm the only way I can think to do this is with an automation I’m afraid, and I’ve set it up here for you to check out
The problem with automations is that we currently can’t compare dates dynamically, and so the idea is to convert your date data into milliseconds using DATETIME_FORMAT. In the gif above you can see that I’ve converted 30 days before and after the set date into milliseconds, and in the ‘Dates’ table I’ve done the same:
This allows us to search the dates dynamically as they’re now just converted into numbers, and s we just do ‘If the millisecond number value is larger than the 30 days before millisecond value, etc’: