Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Bug with Data Fliter

SoccerTil
8 - Asteroid

I created a custom filter on a date to select records for the max date and the date before. if I use [Date] >= DateTimeAdd([Max_Date],-1,'DAYS') I only get the MAX record. if I reverse the logic to [Max_Date] <= DateTimeAdd([Date],1,'DAYS') I get both days. If I use a formula to create the previous date as a column then the filter [Date] >= [yesterday] works. I've attached the workflow sample.

2 REPLIES 2
OllieClarke
16 - Nebula
16 - Nebula

Hi @SoccerTil if you wrap your datetimeadd() in a todate() function like below, then the filter works as expected. 

 

ToDate(DateTimeAdd([Max_Date],-1,'DAYS'))

 

OllieClarke_0-1612377578489.png

The datetimeadd() function, as its name suggests, will default to the datetime data type, and as we can't control the data type in a filter, like in a formula then we need to use the ToDate() function here.

If you convert your [Yesterday] field to a datetime, then you'll see the same issue as before.

 

Ultimately what's going on is that 2020-01-03 != 2020-01-03 00:00:00

 

Hope that helps,

 

Ollie

 

SoccerTil
8 - Asteroid

Thanks for the answer. Good to remember that the result is a date time. I'll share with all my peers.

Labels
Top Solution Authors