Alteryx Designer Discussions

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

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!

Problems with Date Time Difference

5 - Atom

The following function results in the date difference of 0. I would expect that this would result in a date difference of 1. What is causing this issue? This seems to work with any other month difference with the exception of January and February month ends. These hard coded dates shown here are replaced with formulas in the actual data that I am working with. 



Alteryx Certified Partner
Alteryx Certified Partner
Did you try a data type of int16?
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Alteryx Certified Partner



It's because of how that function compares the two date values to output the difference. Image below is from help site and looking at the part highlighted, the day on the end date (first value) has to pass the start date. Since this won't happen in Feb, the month won't add until it goes to the next day.


One way that you can ensure that month diffs are always progressing is to trim your date values to the first of the month. Below is a formula that would give you the output you're looking for.


Hope this helps!



5 - Atom

This fixed the problem. Thanks!