
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Rounding timestamp to hour
Hello Everyone,
I have a field called readtimestamp% . we have some books where people read we get timestamp. we need to find how many people read per hour on a day.
It has something like
02/02/2014 01:07:00
02/02/2014 00:00:14
How can i round them to
02/02/2014 01:00:00
02/02/2014 00:00:00
Thanks,
Venkata
- « Previous Replies
- Next Replies »

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try
round(readtimestamp%, 1/24)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nope thats giving me the same no of reads per the day. I want to show reads per each hr since each read has a timestamp

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not clear...
Number of reads per time period doesn't depend on rounding. If it is in the front end chart, timestamp rounded per hour (date-hour) should be your dimension. If it is in the script, you have to group by date-hour.
Can you upload an example of your app?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Load *,
timestamp#(left(Timestamp,10)&' '&MakeTime(left(right(Timestamp,8),2)),'DD/MM/YYYY HH:MM:SS') as Roundtimestamp
from path ;
hope this helps

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am currently looking to keep the solution in the front end in dimension.
May be the attached sample give you an idea .
Thanks,
Venkata

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
=subfield(DateTime, ' ', 1)& ' ' & time(round(time#(subfield(DateTime, ' ', 3), 'hh:mm:ss'), 1/24), 'hh:mm:ss')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This looks better solution. Can you help me to write in front end .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If on the front end, use this calculated dimension instead of your current dimension:
=timestamp(round([Consumption Timestamp], 1/24), 'MM/DD/YYYY hh')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi venkata,
this must be
timestamp(round(readtimestamp% * 24) / 24) as readtime
- Ralf

- « Previous Replies
- Next Replies »