Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculating Hrs from 2 dates fields

How do you calculate hrs between columns L minus K ?

please see attached file for the format. 

any help would be highly appreciated.

1 Solution

Accepted Solutions
MarcoWedel

Hi,

one solution might be to create a seperate interval field to calculate with:

QlikCommunity_Thread_137980_Pic1.JPG.jpg

LOAD *,

    Interval([Assign Date]-[Received Date]) as Interval

FROM [http://community.qlik.com/servlet/JiveServlet/download/635003-132397/Example.txt] (txt, unicode, embedded labels, delimiter is '\t', msq);

hope this helps

regards

Marco

View solution in original post

7 Replies
Not applicable
Author

here is what i came up with but its not working out:

vHrsMult

* sum({$<$(sMTD(Production)),[Submission Transaction Types]={'QUOTED'},[Received Via]={'BSS'}>}

  rangesum(

  [Assign Date]

  ,-[Received Date]))

/ Count({$<$(sMTD(Production)),[Submission Transaction Types]={'QUOTED'},[Received Via]={'BSS'}>} [Assign Date])

maxgro
MVP
MVP

this is the difference in hour between two dates

replace the dates with your fields

=

(

date#('2/13/2014 12:27', 'MM/DD/YYYY hh:mm') -

date#('2/12/2014 15:03', 'MM/DD/YYYY hh:mm')

) * 24

Not applicable
Author

how would you change this formula?

Where 'Assign Date' = L and 'Received Date' =K

vHrsMult

* sum({$<$(sMTD(Production)),[Submission Transaction Types]={'QUOTED'},[Received Via]={'BSS'}>}

  rangesum(

  [Assign Date]

  ,-[Received Date]))

/ Count({$<$(sMTD(Production)),[Submission Transaction Types]={'QUOTED'},[Received Via]={'BSS'}>} [Assign Date])

MarcoWedel

Hi,

one solution might be to create a seperate interval field to calculate with:

QlikCommunity_Thread_137980_Pic1.JPG.jpg

LOAD *,

    Interval([Assign Date]-[Received Date]) as Interval

FROM [http://community.qlik.com/servlet/JiveServlet/download/635003-132397/Example.txt] (txt, unicode, embedded labels, delimiter is '\t', msq);

hope this helps

regards

Marco

Not applicable
Author

but how to implement "interval" into this :

vHrsMult

* sum({$<$(sMTD(Production)),[Submission Transaction Types]={'QUOTED'},[Received Via]={'BSS'}>}

  rangesum(

  [Assign Date]

  ,-[Received Date]))

/ Count({$<$(sMTD(Production)),[Submission Transaction Types]={'QUOTED'},[Received Via]={'BSS'}>} [Assign Date])

Not applicable
Author

anyone?

villegasi03
Creator
Creator

I am sorry I a little confused. Just to be clear. You are asking how to get the difference of time between two values from two columns right? Sorry I am going to simplify this so its clear in this example,

row 1 column 1 = " your first timestamp "

row 1 column 2 = " your second timestamp "

and you need the difference between the two in hours?