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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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