Skip to main content
Solved

Filter records by current week

  • February 27, 2023
  • 9 replies
  • 176 views

Rupert_Hoffsch1
Forum|alt.badge.img+21

Hi there. Has anyone figured out how to filter records in Interfaces for current week? I want to summarize values for this ongoing week and don't really know how right now. Thanks!

Best answer by Rupert_Hoffsch1

OK, I was a dumb***. Of course we can still use formulas and have a formula calculate if it is the current week. 

 
IF(WEEKNUM(NOW()) = WEEKNUM(Date), 1, 0)

9 replies

sjohnson
Forum|alt.badge.img+4
  • New Participant
  • February 27, 2023

The only way I have been able to do this was to create a filter with 2 conditions.  one that has a Starts on or after x date and another that starts on or before x date.


Rupert_Hoffsch1
Forum|alt.badge.img+21

The only way I have been able to do this was to create a filter with 2 conditions.  one that has a Starts on or after x date and another that starts on or before x date.


Thanks. But the date you're comparing to is not dynamic, right? So the user has to set the current week, it's not automatically assigned by Airtable.


Rupert_Hoffsch1
Forum|alt.badge.img+21
  • Author
  • Brainy
  • Answer
  • February 27, 2023

OK, I was a dumb***. Of course we can still use formulas and have a formula calculate if it is the current week. 

 
IF(WEEKNUM(NOW()) = WEEKNUM(Date), 1, 0)

Forum|alt.badge.img
  • New Participant
  • May 23, 2023

OK, I was a dumb***. Of course we can still use formulas and have a formula calculate if it is the current week. 

 
IF(WEEKNUM(NOW()) = WEEKNUM(Date), 1, 0)

But does the table update itself? So it puts all of the numbers to 0 that were 1 previus week?


Rupert_Hoffsch1
Forum|alt.badge.img+21

But does the table update itself? So it puts all of the numbers to 0 that were 1 previus week?


Yes 🙂 Airtable formulas are instantaneous


Forum|alt.badge.img
  • New Participant
  • May 23, 2023

Yes 🙂 Airtable formulas are instantaneous


Oh ok thanks helped a lot actually.


Forum|alt.badge.img
  • New Participant
  • May 23, 2023

Yes 🙂 Airtable formulas are instantaneous


I found a problem with this tacric so when a new year starts You will have 2 weeks with the same week number.


Rupert_Hoffsch1
Forum|alt.badge.img+21

I found a problem with this tacric so when a new year starts You will have 2 weeks with the same week number.


You mean that different years can span across the same week?


Forum|alt.badge.img
  • New Participant
  • May 24, 2023

You mean that different years can span across the same week?


Yes so next year when the same week comes you will have this week and the same week from a year ago both labeled with 1. Hope that makes sense