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.
SOLVED

Date

magsbiel
7 - Meteor

How do I subset dates so it only includes this month and previous month dates. The date format is 8/24/2020.

Thank you

3 REPLIES 3
Emil_Kos
17 - Castor
17 - Castor

Hi @magsbiel

 

i don’t have currently acces to PC but you can try reading this topic:

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Filtering-to-previous-month/td-p/78166

 

i think this will give you an idea!

RolandSchubert
16 - Nebula
16 - Nebula

Hi @magsbiel ,

 

you can use a Filter tool using the formula:

 

DateTimeTrim(DateTimeParse([Date], '%m/%d/%Y'), 'month') >= DateTimeTrim(DateTimeAdd(DateTimeToday(), -1, 'month'), 'month')

 

It converts your date (which is a string) to a date data type, "trims" it to the month and selects only the records with a month >= the previous month.

 

Let me know if it works for you.

 

Best,

 

Roland 

magsbiel
7 - Meteor

Thank you! It worked.

Labels
Top Solution Authors