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

Subtract two timestamps to output difference in minutes

Can anyone assist in subtracting two date/time fields to output difference in minutes.

DD/MM/YYYY hh:mm:ss is my format, but I want it to output just the minutes not the seconds and if it goes into an hour instead of showing 01:10 display 70

18 Replies
Not applicable
Author

qview.png

I believe my settings are correct please advise if I am incorrect.

Not applicable
Author

I should also mention I just wanted the end result for the example above to show -6

I think I have previously stated that I only want minutes not hours as I think I wrote a second ago so if its 1 hour and 15 difference just want it to display 75 minutes.

Before getting to that format however I wanted to get it right

swuehl
MVP
MVP

You are probably talking about the Delay Mins expression, right?

Why don't you use the interval format option with the format code we suggested ('mm')?

(or use expression default as number format option and use

=interval(sum(...)-sum(...),'mm')

as expression.)

This should also get the sign right.

Not applicable
Author

Hi Swuehi,

I am indeed referring to the expression.

I did try that initially however populated the same result. I feel I have missed a step and am unable to see what the error is.

QVIEW2.png

Not applicable
Author

Hi I think I have managed to figure out where I was going wrong. I had formatted everywhere apart from in the number tab configuring interval to mm

swuehl
MVP
MVP

So what do you get if you are using this expression? A two digit month  number, i.e. 00?

(Please note that AFAIR, 'MM' is the format code for month, not minute...)

Not applicable
Author

Hi Sorry I used lower case mm and it populated the correct information.

If I have an additional query should i start a new thread? its an extension of this query

swuehl
MVP
MVP

If it's directly related to your OP, you may just add it here.

I general, I personally do prefer one question - one thread.

Not applicable
Author

It is linked but I will start  new thread and assign this one as answered. Thanks to everyone for your assistance hoping to get to all your levels in the future