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

Ongoing configuration to remove last months

maxi_reperger
5 - Atom

Hi everybody,

 

I'm working on a dynamic workflow where from a data set that contain many dates, I need to remove the current and last month entries every time this process will run on a monthly basis.

 

I've been able to set up the workflow to filter the entries with data from the current month, however I've not been able to set anything to pull the date from "Current Month -1" let's say.

 

 

Any thoughts?

 

 

Thanks !

3 REPLIES 3
DanS
9 - Comet

Hey there, 

 

I attached a workflow that adds a conditional check. (You can edit the formula to return anything in the "MonthCheck" column).

 

Its using the DateTimeNow() formula to check the days date, then parsing that to only month and comparing that to "Field2" which is in a date format. 

 

Let me know if this works, I know it's a little sloppy but it's Friday. : ) 

monthcheck.jpg

Treyson
13 - Pulsar
13 - Pulsar
I am going to expand a little on @DanS reply, which does solve the current month and previous month problem for the most part. However, January can be difficult with this solution since the number value for 1-1 = 0, instead of 12, which is what covers December (January's Previous Month). The other thing that we would probably need to take into account in larger data sets is the year. If we are looking at just the month of the date, you may end up removing the current and previous months for all years in the data set. I hijacked Dan's workbook and added a few things to demonstrate his solution, but expanded to solve these other things. The cool thing about Alteryx is that there are like... a billion ways to solve a problem. I added a second example on that workbook that is a singular formula that should cover everything we have talked about here. Let me know if you have any questions.
Treyson Marks
Senior Analytics Engineer
SanK
5 - Atom

Why go through all that trouble?

 

Can't you simply calculate the number of months since say 1900 Jan 1 for both days. Difference between those two months count is the number of months between them.

Labels