Google data studio (Looker) string field HH:MM:SS changed to a duration/ number that allows me to use it in a SUM

307 Views Asked by At

I have two issues I'm trying to solve

#1 I'm importing a data set into Google data studio (Looker) by day that contains a field called 'workout-duration'. This is currently a string field in the format of hh:mm:ss and a typical value looks like '00:45:10'.

So I can accumulate the customers total workout duration time over a month I need to be able to have this field in a state that enables me to sum the total 'workout-duration'. Having this field as a string doesn't allow this but I'm unable to transform it correctly.

#2 In the scenario a customer does >1 workout per day they would have two 'workout-duration' entries. I only want to take into account their workout with the highest workout duration time.

Is this all possible to configure within data studio or do I need to revisit my data source and do the transformation upstream before it being uploaded?

CAST(workout-duration AS NUMBER)

but the output of this is null when applied as a metric

1

There are 1 best solutions below

0
On

this provides the CAST formula needed for the new custom field. You can simply use the MAX setting on the new created field (metric)

Time duration in Google Data Studio