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: 
qlikview979
Specialist
Specialist

Difference between Date and Time

Hi Experts,

I have data like below format

Closed Date,Open Date

10/10/2017 12:15:00 P.M.,10/10/2017 12:05:00 P.M.

27/01/2018   1:00:00 P.M., 25/10/2018 11:00:00 A.M.

I have to calculate difference in between Closed Open-Open Date in Minutes.

Expected Output:-

1) 10(Minutes)

2) 30000(Minutes)       (25,26,27 dates calculation hours  50*60=3000)

omarbensalembpngwassenaarmbaeyens

Regards

Mahesh

13 Replies
qlikview979
Specialist
Specialist
Author

25th date:-13 hours

26th date:-24 hours

27th date:-13 hours


Total :-50 hours (50*60=3000 min)


stalwar1

m_woolf
Master II
Master II

I had some problem with the periods in AM and PM. Once I stripped them out, this worked:

=num((num([Closed Date]) - num([Open Date]))*24*60,'#,##0')

qlikview979
Specialist
Specialist
Author

can you please change the time format from 12 hours to 24 hours remove the A.M&P.M by using Purgechar.

I tried same thing but  i am getting correct output.

-Mahesh

qlikview979
Specialist
Specialist
Author

sorry,

I  am not getting correct output.

Can any one help me on this?

-mahesh

m_woolf
Master II
Master II

Can you post a sample qvw showing the problem?

qlikview979
Specialist
Specialist
Author

Hi Bro,

please find the attached link.

Time Difference

qlikview979
Specialist
Specialist
Author

Hi Bro,

I tried with your logic it not giving result.

Mahesh

pradosh_thakur
Master II
Master II

Hi

Capture.PNG

script:

load timestamp(timestamp#(PurgeChar([Closed Date],' .'),'DD/MM/YYYYhh:mm:ssTT')) AS [Closed Date] ,   
timestamp(timestamp#(PurgeChar([Open Date],' .'),'DD/MM/YYYYhh:mm:ssTT')) AS [Open Date] ;
load * inline [
Closed Date,Open Date

10/10/2017 12:15:00 P.M.,10/10/2017 12:05:00 P.M.

27/01/2018   1:00:00 P.M., 25/01/2018 11:00:00 A.M.
]

straight table

dimension

[Open Date]

[Closed Date]

expression

Interval([Closed Date]-[Open Date],'mm')

Learning never stops.
m_woolf
Master II
Master II

See the attachment (uses your data):