Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sudeepkm
Specialist III
Specialist III

Time format Hour:min (to show every 15 min in dimension)

Hi,

I've a date/time field (field name as Timestamp) in my Data Model.

Records of that field are like 2012-05-03 08:34:25, 2012-05-03 09:54:15, 2012-05-03 20:44:20 etc.

Currently i'm using time(frac(Timestamp),'h:mm tt') which is giving the value like 8:34 AM, 9:54 AM, 8:44 PM

I want to group them in every 30 min so that it shows 8:00 AM, 8:30 AM, 9:00 AM etc in my dimension.

Please help.

Thanks and Regards,

Sudeep

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

Try this:

floor(frac(STARTTIME)*48)/48+floor(STARTTIME) as YourField,    // QV next lowest half hour (1/48 of day)

View solution in original post

2 Replies
m_woolf
Master II
Master II

Try this:

floor(frac(STARTTIME)*48)/48+floor(STARTTIME) as YourField,    // QV next lowest half hour (1/48 of day)

sudeepkm
Specialist III
Specialist III
Author

Wow very quick. Thanks a lot.

It was returning in jullian format so I applied

time(floor(frac(STARTTIME)*48)/48+floor(STARTTIME),'h:mm TT') as YourField, and it retunrs 8:00AM, 8:30 AM etc as expected.

again thanks a lot.

Regards,

Sudeep