Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- JMP User Community
- :
- Discussions
- :
- Column formula to round timestamp to nearest minute

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Sep 26, 2018 8:16 AM
(10613 views)

Hi,

Looking for a column formula to round timestamp to nearest minute.

27/06/2017 12:21:** 13** PM need to round to 27/06/2017 12:21:

Any suggestions?

Cheers.

2 ACCEPTED SOLUTIONS

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Created:
Sep 26, 2018 8:30 AM
| Last Modified: Sep 26, 2018 8:37 AM
(10610 views)
| Posted in reply to message from Onjai 09-26-2018

Hi @Onjai,

I'm sure there are other ways to approach this, but I've had luck with the following when I've needed to do that (this requires that you have a numeric :DateTime column):

`Round(:DateTime / 60) * 60`

(Edited: replaced with the simpler formula pointed out by Jerry)

Hope this helps!

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

I am using the latest version of JMP. The transform worked as well.

Thank you!

5 REPLIES 5

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Created:
Sep 26, 2018 8:30 AM
| Last Modified: Sep 26, 2018 8:37 AM
(10611 views)
| Posted in reply to message from Onjai 09-26-2018

Hi @Onjai,

I'm sure there are other ways to approach this, but I've had luck with the following when I've needed to do that (this requires that you have a numeric :DateTime column):

`Round(:DateTime / 60) * 60`

(Edited: replaced with the simpler formula pointed out by Jerry)

Hope this helps!

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Column formula to round timestamp to nearest minute

Julian,

This worked just fine.

Thank you.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Column formula to round timestamp to nearest minute

Hi Onjai,

If you're using version 14, you can right-click the heading of your Timestamp column, select New Formula Column->Transform->Round. You'll then get a dialog box to set the desired parameters (because you're wanting to round to the nearest minute, you'll just need to select "Nearest" from the dropdown and click OK). This is the resulting formula:

Round(:Timestamp / 60) * 60

If you're using version 14, you can right-click the heading of your Timestamp column, select New Formula Column->Transform->Round. You'll then get a dialog box to set the desired parameters (because you're wanting to round to the nearest minute, you'll just need to select "Nearest" from the dropdown and click OK). This is the resulting formula:

Round(:Timestamp / 60) * 60

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

I am using the latest version of JMP. The transform worked as well.

Thank you!

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Column formula to round timestamp to nearest minute

`:Time Stamp - Modulo( :Time Stamp, 60 );`

Learn it once, use it forever!

Article Labels

There are no labels assigned to this post.