Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sruthi19
Contributor II
Contributor II

How to get the Sum of date ranges based on the Data.

Hi Team,

I have two tables data as below:

Table 1:

IdCreate Date (YYYY-MM-DD HH:SS:MM)Closed Date(YYYY-MM-DD HH:SS:MM)
D-12021-01-01 19:10:232021-01-10 20:10:23
D-22021-01-02 19:10:232021-02-10 19:10:23
D-32021-03-01 19:10:232021-03-10 19:10:23
D-42021-04-01 19:10:232021-04-11 23:10:23
D-52021-05-01 19:10:23 
D-62021-06-01 19:10:232021-06-20 23:10:23
D-72021-07-01 19:10:232021-07-02 20:10:23
D-82021-02-11 11:10:232021-03-11 19:10:23

 

Table 2:

SprintStartDate(YYYY-MM-DD HH:SS:MM)End Date(YYYY-MM-DD HH:SS:MM)
S12021-01-01 00:00:002021-02-10 23:59:59
S22021-02-11 00:00:002021-03-10 23:59:59
S32021-03-11 00:00:002021-04-10 23:59:59
S42021-04-11 00:00:002021-05-10 23:59:59
S52021-05-11 00:00:002021-06-10 23:59:59
S62021-06-11 00:00:002021-07-02 23:59:59

 

From the Table 1 i will get the difference of (Closed Date- Create Date) in Days and i should distinguish them in to sprints as : (Note: This which i have done manually)

Days(Closed Date-Create Date) in Days  
10S1 
39S1 
9S2 
11S3 /S410+1
   
20S5 / S610+10
2S6 
29S2 / S328+1

 

The Output which i should get : 

SprintSum of each Sprint 
S149
S237
S311
S41
S510
S612

 

Note: Table 1 Data i will get from one of the source, Table 2 data is Inline Data.

1 Reply
rubenmarin

Hi, you can use IntervalMatch to assign each row to and interval, you will have to choose if you want to assign them by Crate date or Close date, and use a scrit similar to the one in the help page:

https://help.qlik.com/es-ES/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/Scripting/Scrip...