Looker: format Y axis as "hh:mm:ss"

477 Views Asked by At

In the Looker, I have a column with count of the seconds for a duration. I have scripted in the view to be rendered in the format "hh:mm:ss", with this line in the measure definition:

html:{{ rendered_value | date: "%H:%M:%S" }};;

In the explore, this work for the "Data" section as expected. In the Visualization section the values are displayed as hh:mm:ss when the cursor is hovered over the bars in barplot, but scale on the Y-axis is still in seconds. Check the print screen: just sample of my chart

What I like is to have, let's say, 05:00:00, 10:00:00 on the Y-axis in place of those 2000, 4000 seconds. Any ideas?

2

There are 2 best solutions below

0
On

A quick workaround for this is to have a helper column (calculated field) in your dataset that already contains the desired time formatting, then use that data column for your visualizations.

I found relevant posts in our community and some documents that can help you.

Kindly have the time to review them.

0
On

This is not exactly what I wanted. Especially the last advice refers to the Looker Studio, not to the Looker. In meantime a colleague of mine found a solution: create the measure that contain duration in days not in second, that is divide the original value by (606024) and then format it as "hh:mm:ss".

Anyway I still consider it a technological debt for th Looker. Why is not the value rendering correctly on the axis while it can do it in the data section and on the bars of the bar chart?