Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

sth_wch004
New 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
New Contributor III

Re: Qlik Sense - Interval based on condition

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];

5 Replies
shraddha_g
Honored Contributor III

Re: Qlik Sense - Interval based on condition

how do you get that?

can you elaborate ?

sth_wch004
New Contributor III

Re: Qlik Sense - Interval based on condition

Hi Shraddha,

[Date] - [Date]  = Interval

18 -  3 = 15


shraddha_g
Honored Contributor III

Re: Qlik Sense - Interval based on condition

can you share sample app?

sth_wch004
New Contributor III

Re: Qlik Sense - Interval based on condition

Thanks,

Sure, please refer attached.

sth_wch004
New Contributor III

Re: Qlik Sense - Interval based on condition

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];

Community Browser