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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
alec1982
Specialist II
Specialist II

Produce weekly schedule

Hi Guys,

I have a table with the following:

ID, Hours, Start Date, End Date

1     20     01/01/2013     01/19/2013

2     25     04/30/2013     06/01/2013

I need to produce a table to show a row for everyweek between the start and the end periods

Like the following for the first ID

ID, Hours,     Start Date,      End Date,      Weekend Date

1     20         01//01/2013     01/20/2013     01/05/2013

1     20         01/01/2013      01/20/2013     01/12/2013

1     20         01/01/2013      01/20/2013     01/19/2013

Thxs fr all your help in advance..

Alec

1 Reply
swuehl
MVP
MVP

Try something along these lines:

Set DateFormat = 'MM/DD/YYYY';

LOAD *,

    Date(WeekEnd(StartDate,0,6)+(iterno()-1)*7) as WeekendDate

  INLINE [

ID, Hours, StartDate, EndDate

1,     20,     01/01/2013,     01/19/2013

2,     25,     04/30/2013,     06/01/2013

]

WHILE WeekEnd(StartDate,0,6)+(iterno()-1)*7 <= weekend(EndDate,0,6)

;