Cast your vote for the official 2025 Inspire Pin! Designs were submitted by fellow Community members and reflect the creativity and passion of Alteryx users across the globe. Vote now!
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Filtering data for the last 7 days excluding the weekends

ManishaChand
5 - Atom

Hi I need to filter the dates for the last 7 days excluding the weekends.

3 REPLIES 3
ChrisTX
16 - Nebula
16 - Nebula

Check out the DateTime functions here: Functions (alteryx.com)

 

and the Filter tool

 

These resources may be helpful:  above under Learn > Academy > Learning Paths and Interactive Lessons

 

Chris

cjaneczko
13 - Pulsar

One way to do it would be to add a new field that converts the dates to days of the week, then filter out any of the Sat/Sun records. Use a sample tool and pull the last 7 records after that for the the most recent dates.

 

DateTimeFormat([DateTime_Out],"%a")
OllieClarke
15 - Aurora
15 - Aurora

Hi @ManishaChand 

it depends slightly what you mean. If you want to filter to the past 7 days, and also remove weekends then this filter will work:

datetimediff(datetimetoday(),[Date],'day')<=7
AND 
LEFT(DateTimeFormat([Date],'%a'),1)!='S'

 

image.png

 

If you want to filter to the last 7 non-weekend days (so going back more than 7 days) then things are a bit more complicated...

Labels
Top Solution Authors