Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
CK_WAKE
Contributor III
Contributor III

Days difference by Dimension

Hi There,

I would like to find out the number of days difference by dimension (ID). Example as below.

 

ID  DATE DESC Days DIFFERENCE
A123 1/01/2020 Work in Progress Null
A123 10/02/2020 COMPLETE 40
A124 1/03/2020 Work in Progress Null
A124 1/03/2023 COMPLETE 1095

 

 

1 Solution

Accepted Solutions
Sayed_Mannan
Creator
Creator

Hi, try this,


LOAD ID,
DATE,
DESC,
If(DESC = 'COMPLETE', Interval(DATE - Peek(DATE), 'd'), 'Null') as Days_DIFFERENCE
RESIDENT YourTable
ORDER BY ID, DATE ASC;

If it works, please mark this as a solution.

Replace YourTable with your exact table name;

 

View solution in original post

1 Reply
Sayed_Mannan
Creator
Creator

Hi, try this,


LOAD ID,
DATE,
DESC,
If(DESC = 'COMPLETE', Interval(DATE - Peek(DATE), 'd'), 'Null') as Days_DIFFERENCE
RESIDENT YourTable
ORDER BY ID, DATE ASC;

If it works, please mark this as a solution.

Replace YourTable with your exact table name;