Forum Discussion

joel121960's avatar
joel121960
Helper I
1 year ago
Solved

formato hora

me podrian ayudar a crear una nueva columna donde se convierta en los valores en rojo .

 

 27     = 00:00:27

67   =    00:01:27

 

 

  • Hi joel121960 -Puede lograr la transformación de formato que necesita para las columnas "tiempo de llamada" y "tiempo de conversación" en

    Fórmula de columna personalizada: en Power Query, cree una nueva columna personalizada y use la siguiente fórmula para representar los valores de tiempo de timbre como una cadena con formato hh:mm:ss:

     

    let
    totalSeconds = [ringtime], // The integer value in seconds
    hours = Number.IntegerDivide(totalSeconds, 3600), // Get hours
    remainingSeconds = Number.Mod(totalSeconds, 3600), // Get the remaining seconds after hours
    minutes = Number.IntegerDivide(remainingSeconds, 60), // Get minutes
    seconds = Number.Mod(remainingSeconds, 60) // Get the remaining seconds after minutes
    in
    Text.PadStart(Text.From(hours), 2, "0") & ":" & Text.PadStart(Text.From(minutes), 2, "0") & ":" & Text.PadStart(Text.From(seconds), 2, "0")

     

    cree una nueva columna personalizada y agregue el siguiente código, espero que esto funcione

     

  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for the reply from rajendraongole1.

     

    Hi joel121960 ,

     

    You can also use the following method.

     

    Create a column:

    talktime = 
    VAR _ringtime = [ringtime]
    VAR _hour = INT(_ringtime / 3600)
    VAR _minute = INT(MOD(_ringtime, 3600) / 60)
    VAR _second = MOD(_ringtime, 60)
    RETURN FORMAT(TIME(_hour,_minute,_second),"hh:mm:ss")

     

    Best Regards,
    Zhu

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

     

2 Replies

  • Hi joel121960 -Puede lograr la transformación de formato que necesita para las columnas "tiempo de llamada" y "tiempo de conversación" en

    Fórmula de columna personalizada: en Power Query, cree una nueva columna personalizada y use la siguiente fórmula para representar los valores de tiempo de timbre como una cadena con formato hh:mm:ss:

     

    let
    totalSeconds = [ringtime], // The integer value in seconds
    hours = Number.IntegerDivide(totalSeconds, 3600), // Get hours
    remainingSeconds = Number.Mod(totalSeconds, 3600), // Get the remaining seconds after hours
    minutes = Number.IntegerDivide(remainingSeconds, 60), // Get minutes
    seconds = Number.Mod(remainingSeconds, 60) // Get the remaining seconds after minutes
    in
    Text.PadStart(Text.From(hours), 2, "0") & ":" & Text.PadStart(Text.From(minutes), 2, "0") & ":" & Text.PadStart(Text.From(seconds), 2, "0")

     

    cree una nueva columna personalizada y agregue el siguiente código, espero que esto funcione

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for the reply from rajendraongole1.

     

    Hi joel121960 ,

     

    You can also use the following method.

     

    Create a column:

    talktime = 
    VAR _ringtime = [ringtime]
    VAR _hour = INT(_ringtime / 3600)
    VAR _minute = INT(MOD(_ringtime, 3600) / 60)
    VAR _second = MOD(_ringtime, 60)
    RETURN FORMAT(TIME(_hour,_minute,_second),"hh:mm:ss")

     

    Best Regards,
    Zhu

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.