Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create a load script that automatically generates the start dates of each month for the financial year

Hello.

How would I generate automatically in the load script a table that contains all of the start dates for each month of the current financial year, assuming April 2010 to March 2011. The data arrives on a monthly basis (at the end of each month) so, for instance, the data for June would be processed at the start of July. Thus when the data is processed in April (theoretically the start of a new financial year) it would actually be reflecting the last month of the old financial year, so the update of the months should reflect a one month offset to allow for this.

The table I would like to automatically generate....

01/04/2010

01/05/2010

01/06/2010

01/07/2010

01/08/2010

01/09/2010

01/10/2010

01/11/2010

01/12/2010

01/01/2011

01/02/2011

01/03/2011

The table I would like generated in May 2011 reflecting the next financial year (April 2011 - March 2012)

01/04/2011

01/05/2011

01/06/2011

01/07/2011 etc

It should be generated in May 2011 rather than April 2011 to relfect that fact the data processed at the start of any month reflects the position for the previous month. Any help will be greatly appreciated.

Many thanks Neil

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Maybe this?

MyNewDateTable:
LOAD date(addmonths(yearstart(addmonths(today(),-1),0,4),recno()-1)) as MyNewDate
AUTOGENERATE 12;

View solution in original post

2 Replies
johnw
Champion III
Champion III

Maybe this?

MyNewDateTable:
LOAD date(addmonths(yearstart(addmonths(today(),-1),0,4),recno()-1)) as MyNewDate
AUTOGENERATE 12;

Not applicable
Author

John.

Many thanks as this is spot on. I really appreciate your help.

Best Regards Neil