Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Year between 2 dates

I have q requirement to find year between 2 dates



M:
LOAD * INLINE [
Document, StartDate, EndDate
350003428, 12/15/2005, 12/14/2011
];

I am exepecting to see the result



2005,2006,2007,2008,2009,2010,2011 for the Document 350003428

I tried

Yearstart(addyears((year(StartDate), IterNo()-1)) <= year(EndDate);

Advance thanks for your help.



1 Solution

Accepted Solutions
Not applicable
Author

Great help. Big Smile. Thank you for quick update.

View solution in original post

3 Replies
Anonymous
Not applicable
Author

[Docs]:

LOAD * INLINE [

Document, StartDate, EndDate

350003428, 12/15/2005, 12/14/2011

];

[NewDoc]:

Load Document,

year(StartDate) + IterNo() as Year

resident Docs

while IterNo() <= (year(EndDate) - year(StartDate));

New Straight Table:
In the expression use : concat(Year,',')


Anonymous
Not applicable
Author

Example attached

Not applicable
Author

Great help. Big Smile. Thank you for quick update.