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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Create yearmonth record for each id

Hi all

I have a table below:

IdYear-Month
1201601
2201604
3201611
4201703

I would like to generate the table below:

Header 1Header 2
1
201601
1
201602
1
201603
1
201604
1
201605
1
201606
1
201607
1
201608
1
201609
1
201610
1
201611
1
201612
1
201701
1
201702
1
201703
1
201704
1201705

Other Record also generate until today year month.

Best Regards,

Louis

3 Replies
Anonymous
Not applicable
Author

Anyone can help?

marcohadiyanto
Partner - Specialist
Partner - Specialist

Hi Louis,

Try searching for master calendar.Optimized code for Master Calendar

Regards,

Marco

antoniotiman
Master III
Master III

Hi Louis,

LOAD ID,
Date(AddMonths(Date#(YearMonth,'YYYYMM'),IterNo()-1),'YYYYMM') as YearMonth Inline [
ID,YearMonth
1,201601
2,201604
3,201611
4,201703
]
While Date(AddMonths(Date#(YearMonth,'YYYYMM'),IterNo()-1),'YYYYMM') <= Date(Today
(),'YYYYMM');

Regards,

Antonio