Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Round down the Date to the hour

saqib
8 - Asteroid

What is the best way to round down a date to the hour:

 

For e.g. 2015-05-04 21:41:56 should become 2015-05-04 21:00:00

6 REPLIES 6
MarqueeCrew
20 - Arcturus
20 - Arcturus
Try

Datetimetrim([date field],”hour”)

Cheers,

Mark
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
JoshKushner
12 - Quasar
Try this formula.

LEFT([date],14) + PadLeft(ToString(Floor(ToNumber(Substring([date],14,2))),0),2,'0')
JoshKushner
12 - Quasar
Actually go with @MarqueeCrew's answer.
MarqueeCrew
20 - Arcturus
20 - Arcturus

@JoshKushner,

 

I like your style :)

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
JoshKushner
12 - Quasar
You constantly teach me new things @MarqueeCrew. Much appreciated. 😊
jdunkerley79
ACE Emeritus
ACE Emeritus

I'd go with @MarqueeCrew for clarity but I would probably use an adjusted version of @JoshKushner myself:

Left([Datetime],14)+":00:00"
Labels