Filter table component using a date (surely there is a way!)

I have a table component that displays data that has a date column.

I want to add a filter that uses this date column.

Instead of ‘today’ I want to use the first day of this quarter. In my case, 1 Jan 2026.

I can calculate 1 Jan 2026 using a JavaScript column, however this JS column available as an option to replace ‘today’.

I don’t really mind how I achieve this, but I want to filter rows that are before and after the start of the current quarter. There is no other col in my data that indicates which date this is.

Javascript always returns a text string type. You will never get a date type returned from a javascript column. If you want to be able to filter by a date, you will either need a basic date column in the same table or the user table, or a math column to dynamically calculate the date from an existing date, such as now/today.

2 Likes

Hi,
You can use this formula with your date colum.
Attached Formula: year(today)*10000 + month(today)*100 + day(today)

1 Like

You can try my math formula.

D - DAY(D) + 1 
- (MIN(MOD(MONTH(D) - 1, 3), 1) * DAY(D - DAY(D))) 
- (MAX(MOD(MONTH(D) - 1, 3) - 1, 0) * DAY(D - DAY(D) - DAY(D - DAY(D))))
4 Likes

That’s a magic one! :mage:

May I add your formula to the date guide?

@ThinhDinh

1 Like

Feels like I’m doing a bit of a disservice not explaining the idea in full, so here it is.

Sorry it’s too big so I have to upload it elsewhere.

3 Likes