Help

how to make an element in interface with single select of month filter

Topic Labels: Interface Designer
219 2
cancel
Showing results for 
Search instead for 
Did you mean: 
ars06
4 - Data Explorer
4 - Data Explorer

ars06_0-1710987729532.png

please help me to add element that will filter result by month, so i want to pick up just month inside filter not date is or is within or something, is there any way?

2 Replies 2

Hmm, you could try creating a new formula field with:

DATETIME_FORMAT({Date Field}, 'MMM YYYY')

That'll output the month of that date field in the format of "Jan 2024", "Feb 2023", etc, and you could use that as your filter element

You'd need to type that into the filter though

If you wanted it to act like a single select field, you'd need to use an automation to paste the value of the formula field above into a single select field I think

AlliAlosa
10 - Mercury
10 - Mercury

I like to do something similar to what @TheTimeSavingCo described, with a few tweaks 🙂

Instead of having an automation copy the resulting month into a single select field, I like to use a linked record field. This results in a table of months where you can aggregate totals through rollups which allows for better insights into your data month over month.

I also would recommend formatting the month with the year first, as this will allow you to sort the data by year, then by month (otherwise it will sort alphabetically which can be annoying).

Last, I’d recommend an IF() before DATETIME_FORMAT(). Otherwise, if there is no date the formula will result in an error… which will result in #ERROR! becoming a record on this new table and in turn, a selectable option in your filter list.

The formula I like to use is:

IF({Date}, DATETIME_FORMAT({Date}, 'YY-MM MMMM YYYY'))

Oh, and just to mention a potential pitfall… as soon as you begin typing a date into a date field, the above formula will start trying to evaluate that date. If you don’t type anything and use the calendar date picker, or if you do type something and are adding data for the current year, this shouldn’t be an issue because airtable will either wait for you to select a date or assume that the date you’re typing is this year. BUT if you’re entering a date that’s in a past or future year and you start typing something, there’s a chance the automation will run too early and paste an incorrect value into the linked record field.

I sometimes set up a second automation that runs on a schedule to fix anything that appears incorrect. Happy to say more about that.