ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now
The Alteryx Community has implemented a new single sign-on experience. If you are having issues with your account, please review the FAQs.

Alteryx Designer Discussions

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

Formula to filter all days of current month until specific date

7 - Meteor

Hi all,


I am trying to create a formula to do two things: 1- filter out any content that doesnt belong to the current month and 2- exclude any days that come after the last thursday available. For example, if I'm running the workflow on monday 1/20, i need it to exclude any days that come after last thursday (1/6). the first part of the formula (that selects current month) works properly. Here's what I did:




What I can't figure out is how to do part 2. Any ideas?



16 - Nebula
16 - Nebula

Hello @Patricia2,


This workflow takes the current month data and then filters out everything after the last thursday:


Bad month to choose this one since it ends in thursday!




If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


13 - Pulsar

There's probably a prettier way to do this, but try the following in a Filter tool:

[Dt]> DateTimeAdd(DateTimeFirstOfMonth(),-1,'second')
[Dt]<= DateTimeAdd(DateTimeToday(),-Switch(DateTimeFormat(DateTimeToday(),'%A'),0,

The first part does essentially what you already have rolling (just a different approach, both should work), the second part checks what day it is today, then backs it up to the last Thursday and filters based on that. Let me know if you'd like a workflow to get a better idea.


Hope it helps!


7 - Meteor

I tried this one and didn't work. it still includes everything.

7 - Meteor

Thanks! I'll try this out and let you know.

7 - Meteor

I adapted this workflow to incorporate date data from the file but it's not filtering anything. This is what I did:




Am I missing something? thanks