Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Kohli
Creator II
Creator II

Caluculate the time diff bn two time stamps

I four columns in a Table. LIke

StartDate,      StartTime,           EndDate,            EndTime

30/09/2018,    22:10:55,           01/10/2018,          00:55:23

01/09/2018,     15:10:55,         02/10/2018,            01:55:23

01/09/2018,    22:10:55,           02/10/2018,          15:55:23

03/09/2018,     15:10:55,           03/10/2018,         22:55:23

 

I want total journey in Minutes.

Labels (2)
6 Replies
Gysbert_Wassenaar

Subtract the start date and time from the end date and time: EndDate+EndTime-StartDate-StartTime

Perhaps when you load the data you have to change text values into date and time values:

LOAD
*,
Interval(EndDate+EndTime-StartDate-StartTime,'mm') as JourneyInMinutes
;
LOAD Date(Date#(StartDate,'DD/MM/YYYY'),'DD/MM/YYYY') as StartDate, Time(Time#(StartTime,'hh:mm:ss'),'hh:mm:ss') as StartTime, Date(Date#(EndDate,'DD/MM/YYYY'),'DD/MM/YYYY') as EndDate, Time(Time#(EndTime,'hh:mm:ss'),'hh:mm:ss') as EndTime, FROM ...source...

talk is cheap, supply exceeds demand
Kohli
Creator II
Creator II
Author

Hello Gysbert,

Thank you for time spent.

  I am getting null records with above formula.

Gysbert_Wassenaar

Then you need to find out what kind of data you're loading. Are they text values or are the numeric values?


talk is cheap, supply exceeds demand
Kohli
Creator II
Creator II
Author

Only numeric values. There is no text values like Am and PM.

Gysbert_Wassenaar

That you don't see AM and PM does not mean that the values are numeric values.  If I type 25 in this post it is text and not numeric.  But if you're sure that they're numbers then I can't help unless you post a small Qlik Sense app with example data that exhibits the problem you describe. So, please post such an example .qvf file.


talk is cheap, supply exceeds demand
Kohli
Creator II
Creator II
Author

Please find below XL file and calculate the time diff in Minuit's.