In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Date filters

Phill
8 - Asteroid

Hello, 

 

I'm trying to filter for everything within the next 2 months but all I'm getting is data for December.

 

Can anyone see what I'm doing wrong?

 

DateTimeAdd(DateTimeFirstOfMonth(),+2,"months")= DateTimeTrim([DateTime_Out],"months")

 

Thanks, 

 

Phill

15 REPLIES 15
Phill
8 - Asteroid

Thanks @atcodedog05 defiantly getting closer. Though its taking everything from the start of October rather from the date of running it. I tried to modify it to use DateTimeNow() but that cut out dates in October for some reason. 

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @Phill ,

 

Its due to your DateTimeTrim("Month"). I will modify to consider date from today date.

atcodedog05
22 - Nova
22 - Nova

Hi @Phill 

 

Here are the modified formulas

 

2 months from today

(DateTimeAdd(DateTimeNow(),+2,"months") >= DateTimeTrim([DateTime_Out],"months"))
and ([DateTime_Out]>=DateTimeNow())

Output:

Hope this helps 🙂

atcodedog05
22 - Nova
22 - Nova

Hi @Phill 

 

Additionally you can use DateTimeToday() instead of DateTimeNow() to include today also.

 

 

(DateTimeAdd(DateTimeNow(),+2,"months") >= [DateTime_Out])
and ([DateTime_Out]>= DateTimeToday())

 

 

Output:

Capture.PNG

 

Hope this helps : )

Phill
8 - Asteroid

Thanks @atcodedog05 that's perfect! Just what I needed. I think I can see where I went wrong too. 

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂

 

Cheers and happy analyzing 😀

Labels
Top Solution Authors