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: 
Not applicable

Loop in QV

Hi guys,

I have a question about the loop in QV. Original I have the date variable, how to expand 12 times of the date starting from the original month+4? You can find the example below, the final table is what I want.

Anyone could help? Thanks!

Original table:

IDdatescore
112/200980
206/201150

Final table

IDdate1datescore
104/201012/200980
105/201012/200980
106/201012/200980
......
103/201112/200980
210/201106/201150
2 11/201106/201150
212/201106/201150
......
209/201206/201150
1 Reply
CELAMBARASAN
Partner - Champion
Partner - Champion

In script

Load

     ID,

     date,

     score,

     Date(AddMonths(Date#(date, 'MM/YYYY'), 3 + IterNo()), 'MM/YYYY') AS date1

Resident OriginalTable

While IterNo() <= 12;

Hope it helps