Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
klikgevoel
Contributor III
Contributor III

Create new records based on data and system date values

Assume the following dataset

Set NullInterpret = '';

Let vCurrentDate = Num(Date(Today()));

Data:

Load * Inline [

Id,StartDate,EndDate

1, 01-01-2019,

2, 25-01-2020, 27-08-2020

3, 01-01-2020,

];

What I try to achieve is creating a new "monthly" record for each record untill an EndDate is hit. So ID 2 will have 8 repeats, while ID 1 and 3 continue till vCurrentDate.

The final result will look like this:

IDYearCounterMonthCounterStartDateEndDate
11101-01-2019 
112  
113  
1......  
1220  
221325-01-2020 
2214  
2215  
2216  
2217  
2218  
2219  
2220 27-08-2020
321301-01-2020 
3......  
Labels (2)
1 Reply
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

What you need is an Intervalmatch function.

Check details here. https://community.qlik.com/t5/Qlik-Design-Blog/Using-IntervalMatch/ba-p/1475510

 

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!