In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Round seconds to minutes

aortegaher87
5 - Atom

Hi, 

 

I wanted to see if it possible to round seconds to minutes. For example:

 

13:23:39 --> 13:24:00

16:48:11 --> 16:48:00

 

The threshold is 29 seconds or below will round down to the actual minute and 30 seconds and above will round up to the next minute.

 

Thanks!

3 REPLIES 3
JagdeeshN
12 - Quasar
12 - Quasar

@aortegaher87 

 

Please check the below discussion on a similar topic.

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Time-Rounding/td-p/37023

 

The replies to this post contain some solutions that you can possibly use.

 

Do let me know if this helped.

 

Best,

Jagdeesh

danilang
19 - Altair
19 - Altair

Hi @aortegaher87 

 

Here's a different method from those in https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Time-Rounding/td-p/37023.

 

 

if DateTimeSeconds([TimeStamp])<=29 then
	DateTimeTrim([TimeStamp],"minutes")
else
	DateTimeTrim(DateTimeAdd([TimeStamp],1,"minutes"),"minutes")
endif

 

If seconds <= 29 trim the timestamp to the minute, else add one minute and trim the result

 

danilang_0-1612708674581.png

 

 

Dan

 

MarqueeCrew
20 - Arcturus
20 - Arcturus

@danilang ,

 

 if the incoming data is purely time, you would need to modify the formula by adding a fixed date to it. 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels
Top Solution Authors