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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to find Monthname between 2 dates

How to find Monthname between 2 dates StartDate and EndDate

DocumentStartDateEndDate
35000342812/15/201012/14/2011
3500034298/1/201012/21/2010
3500034301/1/20094/21/2009


Expecting Results
DocumentStartDateEndDateNew Column
35000342812/15/201012/14/2011Dec2010,Jan2010,……. Dec2011
3500034298/1/201012/21/2010Aug2010,Sep2010,Nov2010,Dec2010


I am looking for the result or value similar like New column

Advance thanks for your help.

1 Solution

Accepted Solutions
disqr_rm
Partner - Specialist III
Partner - Specialist III

Here you go:


M:
LOAD * INLINE [
Document, StartDate, EndDate
350003428, 12/15/2010, 12/14/2011
350003429, 8/1/2010, 12/21/2010
350003430, 1/1/2009, 4/21/2009
];
tmp:
LOAD Document,
monthstart(addmonths(StartDate, iterno()-1)) as Month
RESIDENT M
While monthstart(addmonths(StartDate, IterNo()-1)) <= EndDate;
LEFT Join (M)
LOAD Document,
Concat(monthname(Month), ', ') as AllMonths
RESIDENT tmp
Group By Document;
DROP Table tmp;


View solution in original post

2 Replies
disqr_rm
Partner - Specialist III
Partner - Specialist III

Here you go:


M:
LOAD * INLINE [
Document, StartDate, EndDate
350003428, 12/15/2010, 12/14/2011
350003429, 8/1/2010, 12/21/2010
350003430, 1/1/2009, 4/21/2009
];
tmp:
LOAD Document,
monthstart(addmonths(StartDate, iterno()-1)) as Month
RESIDENT M
While monthstart(addmonths(StartDate, IterNo()-1)) <= EndDate;
LEFT Join (M)
LOAD Document,
Concat(monthname(Month), ', ') as AllMonths
RESIDENT tmp
Group By Document;
DROP Table tmp;


Not applicable
Author

Great Help.Thanks Rakesh. Big Smile