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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Siraj
Contributor
Contributor

Between Date issue

Hi,

I need to generate some information between two dates, Please refer the below example help me to achieve the same

example 

Tool IdAssign DateRunning Date
12345-Mar-2030-Dec-20
567810-Dec-2012-Feb-21

 

I want result like this

 

Tool IDRunning Month
1234Mar-20
1234Apr-20
1234May-20
1234Jun-20
1234Jul-20
1234Aug-20
1234Sep-20
1234Oct-20
1234Nov-20
1234Dec-20
5678Dec-20
5678Jan-21
5678Feb-21

 

Thanks in advance

Siraj

2 Replies
Frank_Hartmann
Master II
Master II

Try this:

TEST:
LOAD * INLINE [
	RunningDateolID, AssignDate, RunningDate
	1234, 05/03/2020, 30/12/2020
	5678, 10/12/2020, 12/02/2021 
];

NoConcatenate

tmp:
LOAD
  RunningDateolID,
  Date(AddMonths(AssignDate,IterNo()-1)) as AssignDate,
  Date(AddMonths(AssignDate,IterNo()-1)) as RunningDate  
Resident TEST
While AddMonths(AssignDate,IterNo()-1) <= RunningDate;

Final:
Load *, Date(RunningDate,'MM/YYYY') as DateNew Resident tmp; DROP Tables TEST,tmp
Siraj
Contributor
Contributor
Author

Thanks Frank,

This logic works perfectly 

 

Thanks 

Siraj