Alteryx Designer Desktop Discussions

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

Filter the last 13 months dynamically

Mari1
6 - Meteoroid

Hi.

I need to filter the last 13 months not including the current month, and I just can't figure out the right function for filter tool

 

Any suggestions?

Thank you

1 REPLY 1
IraWatt
17 - Castor
17 - Castor

Hey @Mari1,

Try this:

 

[Field1] < DateTimeAdd(DateTimeNow(),-13,"months")

 

IraWatt_0-1653488983337.png

DateTime Functions | Alteryx Help - datetimenow returns the current datetime on your PC and Datetimeadd allows you to minus months/days of the current time.

Could add in Datetimetrim to ensure that the datetime now is taken from the start of the month and the less then will ensure that the current month is not included: 

 

[Field1] < DateTimeAdd(DateTimeTrim(DateTimeNow(),"firstofmonth"),-13,"months")

 

Any questions or issues please ask :) 

HTH!

Ira

 

Labels