Filter specific days of the week

Data Pipeline

Say you want to filter out weekends or your business days comprise of a Monday - Saturday week or a Monday - Thursday week. How do we filter these other days of the week out?

This can be done in our data pipeline. Our data pipeline uses SQLite so we can employ functions that SQLite uses. Our first step is our query. We will need to select “Day of” as our time bucket for our date field. Let’s use this query as an example:

Create a chart to filter by days of the week

Our next step will be to add an “Add Column” step in the pipeline. We will call this column “DOW” and select to use a custom formula: strftime(‘%w’, “Day of Created Date”)

Add a column in the Pipeline

Once we do that we have our days of the week listed out. Sunday = 0 to Saturday = 6. We can now filter out 0 and 6 using a filter row step. We’ll exclude rows matching ALL conditions where DOW is one of 0 and 6:

Filter rows in the Pipeline

And that’s it! We’ve now excluded all the Saturday and Sunday data.

Related Data Pipeline Help Articles

See more