Hey, guys. I have a long table with events and dates to them, sorted by date. But for some events, I don’t know exact date, only the month or season. And I need to somehow push these events with an inaccurate date into the sorting, so that, for example, the event that will be in the fall, is in the same place as other autumn events with an exact date. Cause when all of them at the bottom - it’s very inconvenient…
Unfortunately there is no quick way to sort it out.
You are requiring an intelligent date parser, and this really depends on the possible “rough” input you have.
Assuming you have a Time Input (Text) column, it can contain:
Autumn 2021
2021 Autumn
Autumn
Oct '21
2021 October
Oct-21
…
You have to write yourself the logic to recognise the date components to become an actual (sortable) date.
So, the discriminant here is: do you have a finite set of possible rough inputs?
This can give an estimated complexity of the formula.
The first column is just a name
The second column is the date for events with an exact date
The third column is a tag for events without dates, just for beauty
The fourth column is the date for events without dates, which simply determines their location in the table.
The fifth column is the most important thing. The formula. The dates from the second and fourth columns are automatically copied to this column, and the entire table is sorted by the formula
Formula: (not empty(prop(“EventDate”))) ? prop(“EventDate”) : prop(“Date for events without dates”)
But can it be improved a little? For example, when I put the “Autumn” tag, what would always automatically set September 1 in the “Date for events without a date” column?
Hey there, it looks like in Notion the rows* are automatically assigned the first date within the date range for you. You can set up something similar by using the Value for new rows in your column options. What I was thinking before was that the dates needed to be randomized, but if the first date within the date range works you can reference the control name followed by .First(). Here’s a screenshot for reference.
This is what I initially thought you were going for, where a date is randomly assigned from the date range rather than the first date from the range being used. Either way, the value for new row will always be a date within the range selected in the date range picker. Hope this helps!
But also, have a look at the modified version of the doc.
You can “extend” the Seasons table so that it holds a default date.
Things are getting a bit more - but definitely doable - if you need to have wider seasonalities (i.e. more years).
But if you are limited to one year, this is already working.