Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculating data in same column

Hi Guys, I need to calculate days in a column of dates for example :-

10/01/2012

31/03/2012

05/04/2012 etc.

The problem I have is that in the QVD I load, all the dates in the same column have the same field name. How do I calculate the number of days between the two different dates in this instance.

Paul.

1 Reply
giakoum
Partner - Master II
Partner - Master II

[test]:

LOAD * INLINE [

    F1

    10/01/2012

     31/03/2012

     05/04/2012

];

[test2]:

LOAD

     F1

     ,previous(F1) as PF1

     ,date#(F1, 'DD/MM/YYYY') - Date#(Previous(F1), 'DD/MM/YYYY') as F2

Resident [test];

make sure you order them correctly during load