Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
rathnam_qv
Creator
Creator

Create Calendar

hi all,

i need to create calndar....

can any one help me to cretae...

Thanks in advance!!!!!

Smiley

1 Solution

Accepted Solutions
er_mohit
Master II
Master II

if your problem resolved then mark it as either helpful or correct answer so that it might be helpful for other developer

View solution in original post

2 Replies
er_mohit
Master II
Master II

try this code

// Calender

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

LET vDateMax = Floor(monthEnd(Today()));

LET vDateToday = Num(Today());

     TempCalendar:

  LOAD

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

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

  AUTOGENERATE 1

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

     Calendar:

   

LOAD Distinct

Date(TempDate,'DD-MM-YYYY' ) AS CalendarDate,

     

// Standard Date Objects

  Day(TempDate) AS CalendarDayOfMonth,

  WeekDay(TempDate) AS CalendarDayName,

  Week(TempDate) AS CalendarWeekOfYear,

Month(TempDate) AS CalendarMonthName,

num(Month(TempDate)) AS CalendarMonthNo,

Week(TempDate) &' '&Month(TempDate) AS weekmonth,

'Q' & Ceil(Month(TempDate)/3) AS CalendarQuarter,

  Year(TempDate) AS CalendarYear,

// Calendar Date Names

  WeekName(TempDate) as CalendarWeekNumberAndYear,

  MonthName(TempDate) as CalendarMonthAndYear,

  QuarterName(TempDate) as CalendarQuarterMonthsAndYear,

     // Start Dates

  DayStart(TempDate) as CalendarDayStart,

        MonthStart(TempDate) as CalendarMonthStart,

  QuarterStart(TempDate) as CalendarQuarterStart,

  YearStart(TempDate) as CalendarYearStart,

QuarterEnd(TempDate) as CalendarQuarterEnd,

YearEnd(TempDate) as CalendarYearEnd,

YearName(TempDate,0,4)as FiscalYear,

'Q' & Ceil(Month(TempDate)/3) & '/' & Year(TempDate) AS CalendarQuarterAndYear,

  Year(TempDate) & '/' & 'Q' & Ceil(Month(TempDate)/3) AS CalendarYearAndQuarter,

  RESIDENT TempCalendar

Where TempDate>01-01-2007 //ORDER BY TempDate ASC

;

//DROP TABLE TempCalendar;

er_mohit
Master II
Master II

if your problem resolved then mark it as either helpful or correct answer so that it might be helpful for other developer