Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikview979
Specialist
Specialist

Time Difference

Hi Experts,

please find the attached file.

I have to columns  are Closed date,Open date.

I need the exact difference between two days. i need to show them difference in Minutes.

if we  have 1 day difference between two days we need to consider  24*60=14440 (Minutes)

stalwar1omarbensalemloveisfailmtogwassenaarmbaeyens

Regards

Mahesh

6 Replies
swuehl
MVP
MVP

You can just subtract the dates (if they were properly interpreted as such) and format:

=Interval(Today()-(Today()-1),'mm')

resp.

=Interval(CloseDate-OpenDate,'mm')

If you need to calculate further with your minutes, use

=(CloseDate-OpenDate) * (24*60)

qlikview979
Specialist
Specialist
Author

Sorry bro,

attachment missed.

I tried it not giving correct result

can u please help me on this?

qlikview979
Specialist
Specialist
Author

Some cases  closed date and open date is same

In that case i need only time difference.

-Mahesh

swuehl
MVP
MVP

If your field values are timestamps instead of dates, it will also work for time difference in minutes.

See also

Why don’t my dates work?

Get the Dates Right

QlikView Date fields

qlikview979
Specialist
Specialist
Author

Hi Bro,

I tried many way but i am not getting correct result.

its a Urgent requirement  can u help on this with my data.

Regards

Mahesh

swuehl
MVP
MVP

How does your script look like? Are the timestamps interpreted correctly (follow HICs advice in 'why don't my Dates work' to check)?

The format should look like

SET TimestampFormat = 'M/D/YYYY h:mm:ss TT';

LOAD ClosedTime,

          OpenTime,

        Round((ClosedTime-OpenTime)*(24*60)) as DurationMinutes

FROM ....;