Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

calendar automatically generation

Hi,

I want to add a time dimension and i don't know how to generate automatically a calendar on Qlikview with a min and max date?

Yours faithfully

3 Replies
Not applicable
Author

use this set minyear=2009; set maxyear=2010; for i=$(minyear) to $(maxyear) CalendarRaw: load date(makedate($(i))+recno()-1,'DD-MM-YYYY') as Calendar autogenerate 365; next i Hope this will solve the problem
Not applicable
Author

I find this :











LET

vDateMin = Num(MakeDate(2000,1,1));

LET

vDateMax = Floor(YearEnd(AddMonths(Today(), 12)));

LET

vDateToday = Num(Today());

TempCalendar:



LOAD

$(vDateMin)

+ RowNo() - 1 AS DateNumber

,

Date

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

AUTOGENERATE

1

WHILE

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

MasterCalendar:



LOAD

TempDate

AS CalendarDate

,

Day

(TempDate) AS CalendarDay

,

WeekDay

(TempDate) AS CalendarWeekDay

,

Week

(TempDate) AS CalendarWeek

,

Month

(TempDate) AS CalendarMonth

,

Year

(TempDate) AS CalendarYear

,

'Q'

& Ceil(Month(TempDate)/3) AS CalendarQuarter

,

WeekDay

(TempDate) & '-' & Year(TempDate) AS CalendarWeekAndYear

,

Month

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

RESIDENT

TempCalendar ORDER BY TempDate ASC;

DROP

TABLE

TempCalendar;

LET

vDateMin = Num(MakeDate(2000,1,1));

LET

vDateMax = Floor(YearEnd(AddMonths(Today(), 12)));

LET

vDateToday = Num(Today())

;





Not applicable
Author

Hi,

Maybe the following code could help you:


Set Init_Date= Date('01/01/2000', 'DD/MM/YYYY');
Set Final_Date = Date('31/12/2002', 'DD/MM/YYYY');
Calendar:
load Date($(Init_Date) - 1 + RecNo(), 'DD/MM/YYYY') as Date
autogenerate ($(Final_Date) - $(Init_Date) + 1);


Regards.