Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Query to retrieve range of dates!

Hi All

I am trying to get all the dates using the 'date' field with the use of below code. Though the below code looks correct only it is not returning as expected.

For example:

If the min(ImplStart)=01/01/2011 and max(ImplEnd)=15/01/2011. When I select the date field in the list box it is should give all the dates i,e 01/01/2011,02/01/2011,.. and 15/01/2011. But the below codes returns only those date which are available in the ImplStart and ImplEnd.

Calendar:

Load *,
     Week(date) as Week,
     Year(date) as Year,
     WeekName(date) as WeekName,
     MonthName(date) as MonthName,
     WeekDay(date) as WeekDay
     ;

LOAD DISTINCT
DATE(ImplStart+IterNo()-1) AS date
RESIDENT Change_Calendar
WHILE ImplStart+IterNo()-1<=ImplEnd;

Can some one please help me out for this issue.

Regards

Attitude

Tags (3)
1 Reply
Not applicable

Re: Query to retrieve range of dates!

Hi All

Have attached the sample application for your reference. If any doubts are there then please do let me know.

By the way only difference in the attached application is as shown in bold letters in below code.

Calendar:

     Load *,
     Week(date) as Week,
     Year(date) as Year,
     WeekName(date) as WeekName,
     MonthName(date) as MonthName,
     WeekDay(date) as WeekDay,

     Date(DayStart(date)) as DayStart
     ;
LOAD DISTINCT
DATE(ImplStart+IterNo()-1) AS date
RESIDENT Change_Calendar
WHILE ImplStart+IterNo()-1<=ImplEnd;