Alteryx Designer Desktop Discussions

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

Fetching previous month dates dynamically

Tid14
8 - Asteroid

Hi, I am working on a workflow wherein I need to fetch data from one of the columns only for previous month dates every month as it’s monthly process.

 

Any help on how i can do this.

 

attaching Screenshot of column for your reference where i need to fetch data from “Journal Header Name” column.

C14BC730-5B9A-4A02-861A-4D14D52B391B.jpeg

6 REPLIES 6
binuacs
20 - Arcturus

@Tid14 when you say the previous month, was it based on the current month or any specific date? for eg: based on the current month the previous month is January 2023. But based on your given data it should be October 2022.

DanielG
12 - Quasar

@Tid14  Do you mean like this?  Hope this helps.  I extracted the date with Regex and pieced it back together in formula also creating Last and End of Prior Month so it could be applied in the filter.  You can always do those formulas within the filter too if you dont want to have to deselect those columns afterward as they arent likely to be of much use in an output. 

Tid14
8 - Asteroid

Let's assume in this Case I need to fetch details for November month only.
Then How i should do that?

DanielG
12 - Quasar

@Tid14 Just use the date breakdown from the RegEx tool to filter for 11 in the Month output column.  Please note that in the Regex you would want to change the outputs to integer instead of string so any filter on Month and/or Year worked with greater than, less than, equals, or whatever combination you need.

 

That will work for ad-hoc data pulls and the original post will be more dynamic where you can schedule it to run monthly to always pull prior months information.  Obviously though my workflow is very simplistic just to get the point across.  😀

 

Hope this helps.

ikarimi
5 - Atom

Hey! How to apply same for YTD? 

DanielG
12 - Quasar

@ikarimi  - you can just do a filter on the date field that is DateTimeYear([DateField]) = DateTimeYear(DateTimeToday())

 

That way it will only pull dates for this year.

 

Labels