Alteryx Designer Desktop Discussions

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

Date-time and Days Difference

AJ-CH
8 - Asteroid

Hello, 

Looking for a solution for the difference of StartDate-Days

 

StartDate field is V_String. Always want to see a 280 days prior date to start Date. The output should be in #Days

 

Tried "DateTimeDiff([Expected Delivery Date_Out],'280','days')"

5 REPLIES 5
MarqueeCrew
20 - Arcturus
20 - Arcturus

But did you try:

 

DateTimeAdd([Expected Delivery Date_Out],'-280','days')"

 

 cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
CharlieS
17 - Castor
17 - Castor

The DateTimeDiff( function is used to quantify the quantity of units between two date time values (Ex: the quantity of days between two date values.). In this case, you want to use DateTimeAdd( to return the date value result of adding (or subtracting) units. 

 

DateTimeAdd([Expected Delivery date_Out],-280,"days")

AJ-CH
8 - Asteroid

this is the formate of my data:

 

Expected Delivery Date (V_String)
1/25/2017 12:00:00 AM

 

when used the formula you provided, it is showing Null values.. please suggest 

NickSm
Alteryx
Alteryx

@AJ-CH 

 

I'm guessing the issue is likely because the datetimeadd formula isn't recognizing the incoming field as a date. Try using a date-time tool or formula to format to a Date datatype, then using that calculation.

 

Example attached

 

datetime_add.PNG

AJ-CH
8 - Asteroid

Worked.. thanks 

Labels