How do I subset dates so it only includes this month and previous month dates. The date format is 8/24/2020.
Thank you
Solved! Go to Solution.
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!
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
Thank you! It worked.