Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Alteryx formula not recognizing 2018 is not before 2017

kpombo
7 - Meteor

Hello,

 

I have an if then statement that is not recognizing one date (2018-01-16) is after (2017-12-29). The statement looks like this: If 2018-01-16<2017-12-29 then true otherwise false. It keeps saying false. I have made sure the field names are set as dates and it still won't recognize it. So then I hard coded with the dates in the example and it still won't work. I took this code from a Business Objects report so I know the logic is correct. I just don't understand why it doesn't recognize the date? 

 

Any ideas?

7 REPLIES 7
patrick_digan
17 - Castor
17 - Castor

@kpombo When you say If "2018-01-16" < "2017-12-29", I would expect it to return false because 2018 is not less than 2017. If you wanted to check that the first date of your argument is after the second argument, you would just want to flip your inequality around to if "2018-01-16" > "2017-12-29" which will return true since 2018 is after 2017. Let me know if it's still not working as expected!

Capture.PNG

MarqueeCrew
20 - Arcturus
20 - Arcturus

@kpombo,

 

Try thinking like this:  translate "<" as:  This date comes before That date (alphabetically).  

 

"2018-01-16" > "2017-12-29"

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
kpombo
7 - Meteor

@marqueecrew I formatted both of the fields (not the hard coded dates) as dates but it still won't work. 

kpombo
7 - Meteor

are you saying even with both fields as dates it should still be ">" then "<"

MarqueeCrew
20 - Arcturus
20 - Arcturus

I'll send you a webex if you'd like, but please check this:

 

[Early Date] < [Later Date] = True Result

 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
kpombo
7 - Meteor

See I formatted both fields as dates when I didn't hard code and use the "<" and it still wouldn't work but works just fine and returns correct results in Business Objects. I will try it flipped with the two fields set as dates!

kpombo
7 - Meteor

I get it and it makes sense to me! I just don't understand why it was working so well in Business Objects (maybe it was just dumb luck?) Thanks for the help!

Labels