6 Replies Latest reply: Apr 11, 2011 2:50 PM by Johan Adolfsson RSS

    Help formatting time

      Hi!

      I am loading a textfile that has a "time_duration" field. Unfortunately all the time data isn't formatted the same way.
      The "time" can be formatted both like "1 min 32 sec" and like just "97" (meaning 97 seconds) .
      How can I handle this in Qlikview? I would like all data in that field to be displayed the same minutes and seconds.

      I have been trying to use time() and time#() without success.

      Thanks

        • Help formatting time
          Muralidhar Koti

          Hi,

          Could you please post few rows of sample data from the text file?

          Regards,

          Murali

            • Help formatting time

              Hi Murali!

              Here are some sample data. The data in time_duration field is formatted in two different ways. How can I make it same?
              I have tried time() function with no success. Also tried this...
              //If time_duration string doesn't have "min" in it then convert the data
              if(FindOneOf(time_duration, 'min')=0, Time(Time#(time_duration,'ss'),'hh:mm:ss'), time_duration) as time_duration

               

               

              type number time_duration

              09FB 184461 1 min 16 sec

              09FB 895299 88 --> 1 min 28 sec

              09FB 184461 97 --> 1 min 37 sec

              09FB 184461 2 min 34 sec

              09FC 467018 233 --> 3 min 53 sec

              09FB 467378 0 min 16 sec