Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

to populate all the dates between the start date and end date

Hi Geniuses,

I have two dates with me

Fiscal week start date, lets say it is 03/02/2013

Fiscal week end date, lets say it is 09/02/2013

Now I have to populate date field in script which will contain dates as 03/02/2013,04/02/2013......08/02/2013,09/022013

Thanks in advance

S

2 Replies
Gysbert_Wassenaar

See this blog post


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Its not working out, the ans which is coming through this is attached in imagecal.jpg

But the ans should be for week start 7/26/2009 the values should be 7/26/2009...08/01/2009

and after that the week start shoul change to 08/02/2009 and the dates should populate in this

I am using below script

CONNECT TO [Provider=OraOLEDB.Oracle.1;Persist Security Info=False;User ID=LDW_QLIKVIEW_DS;Data Source=LDW;Extended Properties=""] (XPassword is KRNPbIRJJaSMVEVIXaXIUJdLQSUIEfA);

ETG_Calendar:

SQL SELECT *

FROM

PROD.CISCO_DAY_DIM

Where LDW_FISCAL_YEAR_NUMBER >= 2010;

Calendar:

LOAD

LDW_FISCAL_WEEK_START,

LDW_FISCAL_WEEK_END

//MAKEDate(num(LDW_FISCAL_WEEK_START)-num(LDW_FISCAL_WEEK_END),'MM/DD/YYYY') AS Dates

Resident

ETG_Calendar;

MinMaxDate:

Load

Min(LDW_FISCAL_WEEK_START) as MinDate,

Max(LDW_FISCAL_WEEK_START) as MaxDate

resident

ETG_Calendar;

Let vMinDate = Peek('MinDate',-1,'MinMaxDate') - 1;

Let vMaxDate = Peek('MaxDate',-1,'MinMaxDate');

Drop Table MinMaxDate;

Join(Calendar)

Load Date(recno()+$(vMinDate)) as Date

Autogenerate (vMaxDate - vMinDate);

Drop Tables ETG_Calendar;