Free Trial

Alteryx Designer Desktop Discussions

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

Comparing dates in filter tool

youngjw
6 - Meteoroid

Hello,

 

My input data looks like this:

 

Data Date                                                       Last Location Date 

2024-03-29T13:11:21Z                                  2024-03-29 20:32:29

 

The above is just 1 row of many, where I need to find rows where Last Location is prior (less than) Data Data.

 

Here is the expression I used in filter tool:

 

[Last Known Location Last Reported Time] < [DataDate]

 

It runs, no errors. but the example row above is out on 'T' anchor.  this is suppose to be records that match the expression.  But for the two dates above, Last Location Date is same day, but later time.

 

Is my expression valid to compare two date/time values?  if not, how can I compare date/time?  ty!!

4 REPLIES 4
rzdodson
12 - Quasar

@youngjw without being able to see how that Last Location Date field is being populated, it appears to look correct. I would caution that each row's Last Location Date is aligned to the time specification you are looking for. If there are groups of records that have the same Last Location Date time value, that would be helpful on the data validation front.

Qiu
21 - Polaris
21 - Polaris

@youngjw 
This "2024-03-29T13:11:21Z " is not looking like a data format.
So we need to change it to date Time format first.

0330-youngjw.png

youngjw
6 - Meteoroid

Thank you, Qui!

 

The 'z' at end of time stamp indicates that the time zone is UTC.  this data  is imported from an xlsx file and in excel at least, that field is defined as date / time.

 

At any rate, I am trying your suggestion, but get the following error:

 

ErrorLink: Formula (23): https://community.alteryx.com/t5/*/*/ta-p/710269?utm_source=designer&utm_medium=resultsgrid|The field "" is missing. Compare the tool configuration with the input stream.

 

 

I have this in the expression:

 

Replace(Replace([DataDate], "T", " "), "Z","")

 

Am I missing anything obvious?  thanks agian!

youngjw
6 - Meteoroid

FWIW,

 

The issue appeared to be around the time stamps and as Qui pointed out, maybe Alteryx did not like the ending Z, denoting UTC time zone.

 

Time wasn't critical for my comparison

 

I resolved this by using the DateTime parser and just converted that UTC date / time stirng to a Date that Alteryx then could compare.

Labels
Top Solution Authors