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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
NavinReddy
Creator II
Creator II

Master Calendar

Dear All,

I want to display dates from 2008 to 2014

but this code will displaying only 2010 dates

tell some one help me

where i am wrong

set  vDateMin = MAKEDATE(2008,1,1);

set  vDateMax = MAKEDATE(2014,12,31);

TempCalendar:

            LOAD

             $(vDateMin) + RowNo() - 1 AS DateNumber,

             Date($(vDateMin) + RowNo() - 1) AS TempDate

            AUTOGENERATE 1

            WHILE $(vDateMin)+IterNo()-1<= $(vDateMax);

            MasterCalendar:

            LOAD

            TempDate AS CreatedDate,

            Month(TempDate) AS CalendarMonth,

            Year(TempDate) AS CalendarYear,

            Month(TempDate) & '-' & Year(TempDate) AS CalendarMonthAndYear

            RESIDENT TempCalendar ORDER BY TempDate ASC;

            DROP TABLE TempCalendar;

Thanks In Advance

Niranjan

Labels (1)
11 Replies
aveeeeeee7en
Specialist III
Specialist III

Hi Niru

See the Attachment.

It's very simple and easy to understand. No need of using complex logic and variables Stuff.

Regards

Aviral Nag

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I agree with Nag that it's much easier to create the Calendar without using variables. Nag's example can be made even simpler by using preceding load.

MasterCalendar:

LOAD

Date AS CreatedDate,

Month(Date) AS CalendarMonth,

Year(Date) AS CalendarYear,

'Q'&ceil(Month(Date)/3) AS Quarters,

Month(Date) & '-' & Year(Date) AS CalendarMonthAndYear

;

LOAD

date(makedate(2008,1,1)+recno()-1) as Date

AUTOGENERATE makedate(2014,12,31) - makedate(2008,1,1) + 1;

-Rob