Aggregating on a table with duration (HH:MM:SS)

Hi!

I have a database of customer service stats that includes data about the duration of calls for each day in the format hours:minutes:seconds. I want to create questions like average call duration per week, but it won’t work. The columns with these values doesn’t show up in the dropdown of the “Sum of…”, “Average of…” options in the summarize field in the custom question builder.

The database I’m querying is MySQL and I’ve tried with both the varchar and time format for the columns. With varchar the data shows up as is in metabase (e.g. 00:20:12) and with the time format the data shows as hours of the day (e.g. 12:20 AM). Do I need to use another format? Or maybe a specific combination of formats in both the DB and MB?

Would really appreciate if someone could help me with this.

Hi @trymsk
Currently Metabase does not have a way to understand duration/interval types:
https://github.com/metabase/metabase/issues/8875 - upvote by clicking :+1: on the first post
You would have to return an integer of seconds or minutes to be able to use Sum/Average.

1 Like