value_format result is wrong

Looker Version:
2ec4ca93-7328-43f0-a90a-8cdfc209070f.png

## Context

10e83282-7d89-4c0a-a9c4-223acdf2fc68.png

value_format definition:  

1885bfd3-9d79-4ddb-8b8c-acda8712ca11.png

201 seconds to mm:ss should be 03:21.

3 * 60 + 21 = 201;

4af37059-168a-483c-8f23-4cb96209c000.png

But the looker displayed result is wrong:

26e37aa8-fc04-4d84-8e79-3ba164215e23.png


​​

The result is `03:20` , which is not right.

I create a Calculations:

287dc9f7-d1b3-4231-a9b3-fc475bfc9ab7.png

The Calculations are right:

b78a2eea-42b5-47e6-8003-a4fb79565b9f.png

Also Visualization is correct:

a8553e0a-7434-4139-9a09-2da49dc6f581.png

Code:

```

view: demo {
  derived_table: {
    sql: select 201 as seconds ;;
  }

  dimension: seconds_duration {
    type: number
    sql: ${TABLE}.seconds ;;
  }
  
  measure: total_seconds_duration  {
    label: "Total seconds Duration"
    type: number
    sql:  ${seconds_duration} / cast(86400 as real);;
    value_format: "[hh]:mm:ss"
  }
}

```

Since the data needs to be displayed in a bar chart on the dashboard, if it is changed to manual calculation, it will become a string and the height on the bar chart is wrong.

So Can you please take a look or have a good solution?

0 2 320
2 REPLIES 2
Top Labels in this Space