Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Referencing the next record

Hi,

I am trying to check the average time for each location, The problem is that we have only trackdate and need to find the difference between tracktime for first record to second record. we need to find the difference between first row date to second row date. The last row is not required as there is no possibility of finding the average time. Apart from this we need to change the number format to date. In qlikview we can change the format but i am trying to find this through Query.  and then i have to add this query to existing script.

123452662089Zua200906249111937suresh
123452671220Gas200907109082237mahesh
123452694593Gfil200908269151604sekar
Labels (1)
2 Replies
gussfish
Creator II
Creator II

Hi,

it's counter-intuitive, but you want to use previous()! The trick is to

use it on every field. i.e. something like this:

LOAD

previous(field1) as field1,

previous(field2) as field2,

// (etc)

previous(fieldN) as fieldN,

datetime-previous(datetime) AS Duration

Resident YourInputDataTable;

Angus.

robertomontanar
Partner - Contributor III
Partner - Contributor III

using "order by" descending,  the "previous" behaviour  is like a "next"  (that does not exists....)

I think it's a little boring using previous for each field !

Roberto