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: 
151562
Contributor III
Contributor III

create calendar with for loop

hello
I have a contract table that has a start and end date.
I need to generate a calendar between the smallest start date and the largest end date of a table.
Then make a for loop where I get each contract and its start/end dates, and from my calendar get the dates that are between them.
How can I do this?

Thank you,
FPS
Labels (1)
1 Reply
marcus_sommer
MVP
MVP

You may use an internal while-loop to get each date between start and end and which is then associated with the master-calendar, for example:

t: load contract, start, end, date(start + iterno() - 1) as date
    from source while start + iterno() - 1 <= end;