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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
curiousfellow
Specialist
Specialist

create record in new tabel for every weekstart between two dates

I have to create a record for every weekstart between two dates, So I borrowed this script 

Load *, Week(Date) as Week;

LOAD Date(MinDate+IterNo()-1) as Date 

While MinDate+IterNo()-1 <= MaxDate; 

LOAD Min(startDate) as MinDate, 

     Max(endDate) as MaxDate

AutoGenerate 1;

 

But that gives a record for every day between two dates.

Similar to this I create a record for every month between to dates useing this script:

load *

addmonths(MonthStart(Inschrijvingen.datefrom),IterNo()-1 ) as used_month

Resident date_values

While (date_end)>  AddMonths(MonthStart(datefrom),IterNo()-1);

But there is no such function as addweeks.

What do I miss.

 

 

0 Replies