Convert time to decimal

JBerr
JBerr Member
edited October 22 in Magic ETL

Good Afternoon,

I want to convert my wrapup voice time to a decimal because I want to be able to use that number with interactions to be able to get my Calls Answered, is there a way to do that?

Answers

  • Manasi_Panov
    Manasi_Panov Contributor

    Hi @JBerr,

    Certainly! You can convert it using Magic ETL using various methods. Here's one example to convert recorded time into seconds with Formula tile:

    SUBSTRING(Time, 1, 2)*3600 + SUBSTRING(Time, 4, 2)*60 + SUBSTRING(Time, 7, 2)

    This is the result:

    If you found this post helpful, please use 💡/💖/👍/😊 below! If it solved your problem, don't forget to accept the answer.

  • ggenovese
    ggenovese Contributor

    there is actually a TIME_TO_SEC() function that will convert to seconds, in order for it to be a decimal you have to determine if you want your value to be a fraction of a minute, an hour, or a day

  • Manasi_Panov
    Manasi_Panov Contributor

    Hello @ggenovese,

    I wasn't aware that TIME_TO_SEC() functions with text format. I thought it only accepted a Timestamp format. I've verified that it does work. Thanks for the clarification. Yes, this is a much cleaner and easier solution!

    If you found this post helpful, please use 💡/💖/👍/😊 below! If it solved your problem, don't forget to accept the answer.