In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
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