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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
sth_wch004
Contributor III
Contributor III

Qlik Sense - Interval based on condition

Dear Expert,

How to get day difference based on condition?


Interval between day 3 H1 to day 18 H1 is 15

Capture.PNG

1 Solution

Accepted Solutions
sth_wch004
Contributor III
Contributor III
Author

Thanks for the help,

i managed to get the result by using Previous - script function.

LOAD

*,

IF([Location] = PREVIOUS([Location]),[Date] - PREVIOUS([Date])) AS Interval

RESIDENT [Sheet2]

ORDER BY [Location]

;

DROP TABLE [Sheet2];

View solution in original post

5 Replies
shraddha_g
Partner - Master III
Partner - Master III

how do you get that?

can you elaborate ?

sth_wch004
Contributor III
Contributor III
Author

Hi Shraddha,

[Date] - [Date]  = Interval

18 -  3 = 15


shraddha_g
Partner - Master III
Partner - Master III

can you share sample app?

sth_wch004
Contributor III
Contributor III
Author

Thanks,

Sure, please refer attached.

sth_wch004
Contributor III
Contributor III
Author

Thanks for the help,

i managed to get the result by using Previous - script function.

LOAD

*,

IF([Location] = PREVIOUS([Location]),[Date] - PREVIOUS([Date])) AS Interval

RESIDENT [Sheet2]

ORDER BY [Location]

;

DROP TABLE [Sheet2];