1 Reply Latest reply: Sep 14, 2011 5:21 AM by BlackRockS RSS

    TimeStamp Function

      Could you please help me in converting following below BO query into Qlikview

       

       

      TIMESTAMPDIFF(4, char(TIMESTAMP(( (CASE WHEN(1-1=0) THEN (TIMESTAMP(current date, current time)) ELSE

      ("HistoryTable".START_TIME) END) ))-TIMESTAMP(( "HistoryTable".END_TIME ))))

        • Re: TimeStamp Function

          Hi,

          the chunk of code

          TIMESTAMPDIFF(4, char(TIMESTAMP(( (CASE WHEN(1-1=0) THEN (TIMESTAMP(current date, current time)) ELSE

          ("HistoryTable".START_TIME) END) ))-TIMESTAMP(( "HistoryTable".END_TIME ))))

          is basically trying to calculate the difference in dates "HistoryTable".START_TIME and "HistoryTable".END_TIME.

          You can use

          Load  ("HistoryTable".END_TIME - HistoryTable".START_TIME ) as DiffDays from table..

          in qlikview, but needs to take care of the system date fromat and date format of the data in the table.

          As you know when you load date in Qlikview it will interpret the date in the local system date fromat that you can see in the first tab of the script.

          Cheers.