Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
yoganantha321
Creator II
Creator II

Timestamp difference

I have two timestamp fields JOB_CREATE and  JOB_ONSITETIME

Screenshot_85.png Screenshot_86.png

in the script, I need to calculate a new field JOB_RESPONSE  in minutes  calculated using JOB_ONSITETIME - JOB_CREATE

for eg: 12/29/2016 00:12:20 - 12/29/2016 00:12:16   = 0.04 SECONDS   CONVERT TO MINUTE AS 00

I have used the following in script and got the output as:

Num(Timestamp(JOB_ONSITETIME,'MM/DD/YYYY HH:MM:SS')-Timestamp(JOB_CREATETIME,'MM/DD/YYYY HH:MM:SS'))  as JOB_RESPTIME

Output as:

Screenshot_87.png

which must be 0.04

I need to develop in the script wise, can anyone help me,

regards,

Yoganantha Prakash G P

3 Replies
Anil_Babu_Samineni

May be use this?

Hour(Timestamp(JOB_ONSITETIME,'MM/DD/YYYY HH:MM:SS')-Timestamp(JOB_CREATETIME,'MM/DD/YYYY HH:MM:SS'))

OR

Inteval(Timestamp(JOB_ONSITETIME,'MM/DD/YYYY HH:MM:SS')-Timestamp(JOB_CREATETIME,'MM/DD/YYYY HH:MM:SS'),'HH')

OR

Time(Timestamp(JOB_ONSITETIME,'MM/DD/YYYY HH:MM:SS')-Timestamp(JOB_CREATETIME,'MM/DD/YYYY HH:MM:SS'),'HH')

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
mounachandra1
Creator
Creator

Try This one.

   INTERVAL(JOB_ONSITETIME - JOB_CREATE,'SEC')

MarcoWedel

Hi,

maybe like this?

QlikCommunity_Thread_266016_Pic1.JPG

LOAD *,

     Interval(JOB_ONSITETIME-JOB_CREATETIME, 'm.ss') as JOB_RESPTIME

INLINE [

    JOB_CREATETIME, JOB_ONSITETIME

    12/29/2016 00:12:16, 12/29/2016 00:12:20

];

hope this helps

regards

Marco