How to convert hour in number to human readable like 1 AM, 2 AM ..

Hi team,

I have a date dimension group which has date in raw form. I need to convert below chart which has hour in 12 hours format.

I have used hour_of_day but this gives me 0,1,2,3,4,5,6… 23.

I need dimension as 12:00 AM, 1:00 AM.. 

90f3d21c-2649-4659-9557-e0e343318aa9.png

Can you tell me how to achieve this?

Solved Solved
0 12 1,323
1 ACCEPTED SOLUTION

Yes the hour_of_day, as it suggest, will return an integer, no way to format it through excel-style because the underlaying data is not a timestamp. If you had a timestamp you would get your whole time series.

You have to group by something, in this case, it’s an integer, otherwise you would need to do some tweaks and perhaps create an hour_of_day dimension with always the same date (so that it only creates 24 groupings) but thanks to that you would be able to use the formatting.

I tested this like that: 

88504965-be2c-45f9-8981-6e0bdb2ba78d.png
1cdbc0d7-1101-4171-b8a6-d004cbac01e9.png

View solution in original post

12 REPLIES 12
Top Labels in this Space
Top Solution Authors