Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

The highly anticipated Alteryx Community tradition is back! We hope you'll join us!

Learn More

Date Filter x Days from current date


I have tried using the [Date] = DateTimeAdd(DateTimeToday(),-1,"DAYS") with no luck at this point. Everything I have found here says this should bloody well work but it continues to vex me. If anyone can help it would be greatly appreciated.   


data is here.


What I am trying to do is create an output where the the Summary data is joined to the Historical that is filtered for x days back. I want it to be automatic and set to 7 days. The create the excel sheet TEST.


Hope that makes sense


sheesh the alteryx is here

Alteryx Partner

I think the issue is because `DateTimeToday()` gives you date AND time. So you get: '2018-09-13 00:00:00', and since your existing date columns do not have the time, there are no matches.


By changing your filter to:


[Date] = DateTimeFormat(DateTimeAdd(DateTimeToday(),-1,"day"), '%Y-%m-%d')

I was able to get some records output.


Let me know if this is what you were looking for,




@tcroberts has again provided an excellent solution.


The only possible improvement I would make is to reduce the amount of typing you have to do


[Date] = DateTimeFormat(DateTimeAdd(DateTimeToday(),-1,"day"), '%Y-%m-%d')



[Date] = ToDate(DateTimeAdd(DateTimeToday(),-1,"day"))

ToDate truncates the DateTime value returned by DateTimeAdd to a Date by removing the time information



it solved my purpose really cool.