Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Dates aren't equal

Dismas78
7 - Meteor

Can anyone please tell me why this query is not working, attached is a scaled down sample just to get the point across.

 

The query is trying to filter True anything that is newer than the two current months, and False everything else.

 

The datetime data is equal for may 1st in the filter, but May is dropped into false in the workflow (assuming we are in June now).  I thought it had something to do with time, but the time for both pieces of data being compared are 00:00:00.

2 REPLIES 2
kelsey_kincaid
12 - Quasar

@Dismas78 This is because you're comparing a date with a datetime. You'll want to format your DateTime value as a Date before comparing against the data in your flow. You can either use a formula tool before your filter to do this calculation, then reference the newly created variable in your filter, or you can do it all in your filter as you're doing now (example below).

 

[Test Month]>=
DateTimeFormat(DateTimeAdd(DateTimeFirstOfMonth(),-1,"months"),"%Y-%m-%d")

Rich_Stebles
8 - Asteroid

Hello

 

This works:

 

[Test Month]>=
ToDate(DateTimeAdd(DateTimeFirstOfMonth(),-1,"months"))

 

I presume the "=" part of the comparison doesn't work in the original formulation because it's testing "2019-05-01" against "2019-05-01 00:00" or something like that

 

Regards

Richard

Labels