Alteryx Designer Desktop Discussions

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

Compare two Times for greater than/less than logic

RohitAakula
6 - Meteoroid

Hi,

I'm trying to compare two timestamps and decide whether provided time is before "05:00:00" or not but was not successful, please help me in this case. Thanks in advance!

 

Capture.PNG

4 REPLIES 4
mbarone
16 - Nebula
16 - Nebula

I always like to keep the Date Time Functions page bookmarked, as you'll refer to it a lot.  Check out the DateTime functions - there are a few that will help.  But a fairly straight forward formula should do the trick.

Christina_H
14 - Magnetar

Is this what you're trying to do?

Christina_H_0-1637154480150.png

 

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @RohitAakula,

 

You could achieve this with a formula to parse your time into a date to compare, i've assumed your time is not stored as a time data type just to be sure!

 

 

DateTimeParse(ToString('2000-01-01 ' +[Time]),'%Y-%m-%d %H:%M:%S') <= '2000-01-01 05:00:00'

 

 

JonathanSherman_0-1637154792034.png

 

I've attached my workflow for you to download if needed!

 

Kind regards,

Jonathan

Jonathan-Sherman
15 - Aurora
15 - Aurora

And i'd agree with @mbarone, that DateTimeFunctions is probably my most referred to Alteryx help page!

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels