Setting a filter and excluding weekends

How do I go about setting a filter that doesn’t include the weekends.

So, it would show what needs to get delivered today, tomorrow, and the next day (2 day look ahead) but exclude (saturday/sunday) if it happens to follow on one of those days.

Hi @Erik_Andersson1 :blush: ,

Depending on your setup and where you want to apply the filter but maybe you could try something like :

thisTable.Filter(Dates.Weekday() != 7 AND Dates.Weekday() != 1)

7 is for Saturday and 1 is for Sunday :blush: (As weeks, here on Coda begins on Sunday)

1 Like

I am going to share.a document with you, and hopefully that helps and makes it easier to understand what i am trying.

hi @Erik_Andersson1 , hi @Pch ,

this is my contribution; though I could not see the doc (nor did I ask for permission)

The formula takes the next Monday (= weekday) in case of a weekend.

SwitchIf( = 1,
Date(Today().Year(),ToDay().Month(),, = 7,

cheers, Christiaan

If I understood you right, you want to filter a view to show items due within the next 2 workdays?

There’s an often overlooked formula Workday() that allows you to add X days to a date skipping over weekends and your arbitrary list of holiday dates.

You can then set your filter as this formula:

DueDate >= Today()
DueDate <= Today().Workday(2)

or just the last condition to also include overdue items.

This means, if today’s Monday you’ll get items for Mon, Tue and Wed, but if today’s Friday you’ll get items due on Fri, Mon, and Tue (and also Sat/Sun if there happen to be any).