Converting a duration time text field into a number

I have a field from NetSuite called duration, which is a measure of time in this format 8:30

This stands for 8 hours and 30 minutes of work time.

I need to convert it from a text to a number so I can create measure.

Thank you!

Jayme K.

Tagged:

Best Answers

  • rco
    rco Domo Employee
    Answer ✓

    Try an Add Formula tile and the TIME_TO_SEC function:

    name: duration_sec
    expression:

    TIME_TO_SEC(`duration`)
    

    This should work as long as all your string values are in that hours:minutes format.

    Randall Oveson <randall.oveson@domo.com>

  • JaymeKnapp
    JaymeKnapp Member
    Answer ✓

    Thank you for the quick response! This work perfectly!

Answers

  • rco
    rco Domo Employee
    Answer ✓

    Try an Add Formula tile and the TIME_TO_SEC function:

    name: duration_sec
    expression:

    TIME_TO_SEC(`duration`)
    

    This should work as long as all your string values are in that hours:minutes format.

    Randall Oveson <randall.oveson@domo.com>

  • JaymeKnapp
    JaymeKnapp Member
    Answer ✓

    Thank you for the quick response! This work perfectly!