Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

DateTimeDiff produces negative days

pvara
8 - Asteroid

when using DateTimeDiff ([End_Date],[Start_Date],'days') for some of my data it results in negative values.

Example

Start_DateEnd_DateResult in Days
2017-03-312014-06-02-1033
2018-01-012018-03-3189

 

is there a workaround for this?

 

Thank you

Pete

2 REPLIES 2
CharlieS
17 - Castor
17 - Castor

If you'd like the absolute value of days, use the "abs(" function. The formula below would produce a value of "1033" for your first record.

 

abs(DateTimeDiff ([End_Date],[Start_Date],'days'))

pvara
8 - Asteroid

Thank you Charles it worked like a charm. Your a rock star.

Labels