Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Delete Previous Month Data

mattcap23
5 - Atom

Hello, 

 

I'm trying to find a way to delete or filter data from the previous month. For instance, if it's April, I want to remove all the data from March. 

 

Alteryx example.jpg

4 REPLIES 4
Bren_Spill2
12 - Quasar
12 - Quasar

@mattcap23  - you can convert your data to the Alteryx date format using DateTimeParse and then apply a filter based on month

 

image.png

 

 

image.png

griffinwelsh
12 - Quasar

@mattcap23 see the attached sample solution.

1.Convert the date to Alteryx datetimeformat with label DateTime_Out

2. use a filter with the below formula:

datetimemonth([DateTime_Out]) != datetimemonth(datetimeadd(datetimenow(),-1,"months"))

mattcap23
5 - Atom

Hello Griffin, 

 

I used your formula; however, I noticed that we are using datetimenow. The data that I receive is usually from 3-5 months out and can change throughout the year.  Is there a different formula that can be used? 

CoG
14 - Magnetar

If what you need is is the most recent month of data available, then you can Summarize to find the max date of the dataset and then Append and filter on that. I modified @griffinwelsh 's workflow to do just that:

 

Screenshot.png

 

Happy Solving!

Labels
Top Solution Authors