Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

How to filter out dates on the first of the month

TimM16
5 - Atom

I am building a workflow that has a data set with dates ranging back two years. I need to filter out the dates that fall on the first of the month (I.E. X/1/XX). Is this possible?

2 REPLIES 2
DataNath
17 - Castor

How does this look @TimM16? As your dates aren't in a format that Alteryx can work with (YYYY-MM-DD), we need to use the DateTimeParse() function - I have assumed from X/1/XX that your incoming format is MM/DD/YY so please let us know if not. We then wrap this in the DateTimeDay() function which returns the day as an integer and therefore we then just need to apply a simple check to see if it isn't equal to ('!=') 1:

 

Before:

 

DataNath_0-1665589610195.png

 

After (top, true anchor):

 

DataNath_1-1665589637410.png

alexm06
8 - Asteroid

Hi TimM16,

 

I believe this is possible through using a couple of different tools. 

I've attached an example workflow that applies this filter dynamically for you.

It works by converting the date field to a Date data type. Then using the DATETIMEDAY() function to extract the day of the month. You can then use that value in the Filter tool. 

Let me know if this solves your question!

 

Labels