Search code examples
looker-studio

how to convert seconds to duration using mm:ss format in Google Looker Studio?


let say I have a numeric metric 605 (seconds) then I want to create a new field which is a duration in mm:ss format. so for metric 605 then I want to get 10:05 as a new calculated field

how to do that in Google Looker Studio?


Solution

  • If you're consindering only MM:SS part, you can consider below calculated field

    FORMAT_DATETIME(
      '%M:%S', 
      DATETIME(
        1970, 1, 1, 0, 
        CAST(duration / 60 AS INT64),
        duration - CAST(duration / 60 AS INT64) * 60
      )
    )
    

    enter image description here