Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Mayuri1
New Contributor II

date difference by rows for a single column

Hi,

How can I generate a column to display the difference between two rows? 

date
1/17/2019
1/17/2019
1/20/2019
1/20/2019
1/21/2019
1/21/2019
1/21/2019
1/21/2019
1/21/2019
1/21/2019
1/21/2019
1/21/2019
1/22/2019
1/22/2019
1/22/2019
1/22/2019
1/22/2019
1/22/2019
1/22/2019
1/23/2019
1/23/2019
1/23/2019
1/23/2019
1/24/2019
1/24/2019
1/24/2019
1/24/2019
1/24/2019
1/24/2019
1/24/2019
1/24/2019
1/25/2019
1/25/2019
2 Replies
MVP
MVP

Re: date difference by rows for a single column

Assuming date is a numeric date field:

LOAD date, 
    if(RowNo() <> 1, date - previous(date)) as diff
....
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
MindaugasBacius
Valued Contributor III

Re: date difference by rows for a single column

I guess firstly you need to make an Order by Invoice number (some other metric) and by date itself. Than you can move on to Jontydkpi suggestion.