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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Difference between Row Value and Previous Row Value

Hi all,

i need to replicate this situation:

  

DATEDay
06/08/1115
21/08/114
25/08/119
03/09/1114
17/09/118
25/09/116
01/10/119
10/10/115
15/10/1123
07/11/1116
23/11/1125
18/12/1110
28/12/1144
10/02/1299

For Example  15 = 21/08/11- 06/08/11

How can i do?

Thanks a lot

Labels (1)
2 Replies
sunny_talwar
MVP
MVP

Try this:

Table:

LOAD Date#(DATE, 'DD/MM/YY') as DATE;

LOAD * Inline [

DATE

06/08/11

21/08/11

25/08/11

03/09/11

17/09/11

25/09/11

01/10/11

10/10/11

15/10/11

07/11/11

23/11/11

18/12/11

28/12/11

10/02/12

];

NewTable:

LOAD Peek('DATE')- DATE as Day,

  DATE

Resident Table

Order By DATE desc;

DROP Table Table;


Capture.PNG

Digvijay_Singh
MVP
MVP

This also works -

Input:

Load Date#(Date,'DD/MM/YY') as Date inline [

Date

06/08/11

21/08/11

25/08/11

03/09/11

17/09/11

];

Output:

Load Date,

  if(Date1-Date>0,Date1-Date,0) as Days;

Load Date,

  Peek('Date',recno(),'Input') as Date1

Resident Input;