Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Subtract Date and time

Luukvb
5 - Atom

Hi,

 

I have a problem with substracting two dates/times. In the data a format with milliseconds has been used. I want to subtract [Max_INV_Zero_Degree] of [Max_to_shipment]. But the first problem I faced is transforming the string into  Can someone help me?

 
2 REPLIES 2
MichalM
Alteryx Alumni (Retired)

@Luukvb 

 

I'd first remove the milliseconds - you can use the formula tool with the below expression to do that.

 

 

Replace([Max_to_shipment], Right([Max_to_shipment], 4), "")

 

 

Once done, I'd convert the datetime string to a variable in the correct data type using the DateTime parse tool followed by a formula tool calculating the difference. Attached is an example.

 

 

DateTimeDiff([Max_to_shipment_NEW],[Max_INV_Zero_Degree_NEW],"seconds")

 

 

timediff.png

 

Luukvb
5 - Atom

It is working, thanks!

Labels
Top Solution Authors