Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

time interval between 2 columns

Hi, how do i find the time interval between 2 columns, datecreated and dateconfirmed, and extract the minutes? Thanks.

1 Solution

Accepted Solutions
mayilvahanan
Not applicable

Re: time interval between 2 columns

Hi

Try like this

Edit:

Interval(DateConfirmed - DateCreated , 'mm')

6 Replies
mayilvahanan
Not applicable

Re: time interval between 2 columns

Hi

Try like this

Edit:

Interval(DateConfirmed - DateCreated , 'mm')

Henric_Cronström
Not applicable

Re: time interval between 2 columns

The following expression will give a correct numeric value:

     (dateconfirmed - datecreated) * 24 *60


An alternative is to keep the difference in days (an hour is then 1/24), but format it in minutes:

     Interval(datecreated-dateconfirmed,'mm')

Note that the format code is case sensitive.


HIC

Not applicable

Re: time interval between 2 columns

Hi,

if the two columns, datecreated and dateconfirmed are already formatted as timestamps, you can add the following expression:

time(num(datecreated)-num(dateconfirmed),'mm')

thornofcrowns
Not applicable

Re: time interval between 2 columns

'MM' will give a month interval, 'mm' will give minute interval.

mayilvahanan
Not applicable

Re: time interval between 2 columns

Hi James

Thanks for your reply. I didn't notice that.

jontydkpi
Not applicable

Re: time interval between 2 columns

Hi

Time() is quite different to Interval(). Time(value, 'mm') will format to display the minute number of the current time, while Interval(value, 'mm') will show the number of minutes in value.

     Eg.

          Time(1.55, 'mm') displays 12 (for a time of day of 13:12:00)

          Interval(1.55, 'mm') displays 2232 (number of minutes in 1.55 days)

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein