DAteTimeDiff need output in decimal places
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!
Solved! Go to Solution.
- Labels:
- Date Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yes, it is in Double data format.
Do I just put Round infront of my formula DateTimeDiff([Decision DateTime],[Request DateTime],'hours')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yes, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Glad we could resolve your issue!
Can you please mark this thread as solved, so others can find answers more easily? Thanks!
