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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
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

1 Solution

Accepted Solutions
Nicole-Smith

Your original code fixed with my first post gives me all dates from 1/1/2008 to 12/31/2014.  See the attached file.

View solution in original post

11 Replies
Nicole-Smith

The variables need to be numbers and you need to use let instead of set:

let  vDateMin = num(MAKEDATE(2008,1,1));

let  vDateMax = num(MAKEDATE(2014,12,31));

Not applicable

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


Instead of this use  this one


RowNo()-1+Floor($(vDateMin) As TempDate

MK_QSL
MVP
MVP

LET  vDateMin = Num(MAKEDATE(2008,1,1));

LET  vDateMax = NUM(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;

NavinReddy
Creator II
Creator II
Author

guys again im getting same values

Nicole-Smith

Your original code fixed with my first post gives me all dates from 1/1/2008 to 12/31/2014.  See the attached file.

MK_QSL
MVP
MVP

There is nothing wrong with my code.

It's giving me All required dates.

NavinReddy
Creator II
Creator II
Author

yes but did you check table viewer it shows like 2010

Thanks for your help full answer

Nicole-Smith

Table Viewer stops showing data after a certain number of rows.  You're over the limit.

NavinReddy
Creator II
Creator II
Author

Thank you so much smith