Alteryx Designer Desktop Discussions

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

DAteTimeDiff need output in decimal places

VeronicaElse
8 - Asteroid

Hello, new to Alteryx,

 

I am doing the DateTimeDiff and want the output to be in 2 place decimal. Mine is coming back in whole #s.

 

Thanks!

5 REPLIES 5
Emil_Kos
17 - Castor
17 - Castor

Hi @VeronicaElse,

 

Please check if you are using double as a data format.

 

If you want to change a number of decimal places you can use round function in the formula tool but I think changing the data type should be sufficient for you. 

VeronicaElse
8 - Asteroid

Yes, it is in Double data format.

 

Do I just put Round infront of my formula DateTimeDiff([Decision DateTime],[Request DateTime],'hours')

echuong1
Alteryx Alumni (Retired)

The datetimediff() is going to round to the nearest whole number. What you can do, is calculate the difference in a smaller unit, and then divide to your unit of choice.

 

In the example, I calculated the difference in seconds, then calculated the hours and days. Setting the datatype to fixed decimal with a scale of 2 will leave 2 decimal places.

 

echuong1_0-1612562797801.png

 

VeronicaElse
8 - Asteroid

Yes, thanks!

echuong1
Alteryx Alumni (Retired)

Glad we could resolve your issue!

 

Can you please mark this thread as solved, so others can find answers more easily? Thanks!

Labels
Top Solution Authors