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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
shanky1907
Creator II
Creator II

Inline table Calendar

Hi,

I want to generate an inline table using qv script such that  the table contains fields as Year, Month, Quarter, Week and Day Along with the full Date.

Please help me regarding the matter.

4 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

Look at below code:

Let varMinDate = num(MakeDate(2000,1,1));

Let varMaxDate = num(MakeDate(2020,12,31));

//*************** Temporary Calendar ***************

TempCalendar:

LOAD

  $(varMinDate) + rowno() - 1 AS Num,

  date($(varMinDate) + rowno() - 1) AS TempDate

AUTOGENERATE

  $(varMaxDate) - $(varMinDate) + 1;

//*************** Master Calendar ***************

MasterCalendar:

LOAD TempDate AS Date,

  Week(TempDate) AS Week,

  WeekYear(TempDate) as TestWeek,

  Year(TempDate) AS Year,

  Month(TempDate) AS Month,

  year(TempDate)&'-'&Month(TempDate) as Year_Month,

  MonthName(TempDate) as YearMonth,

  Day(TempDate) AS Day,

  'Q'&ceil(month(TempDate)/3) AS Quarter

RESIDENT TempCalendar

ORDER BY TempDate ASC;

DROP TABLE TempCalendar;

Store MasterCalendar into MasterCalendar.qvd(qvd);

Regards

ASHFAQ

ecolomer
Master II
Master II

Here you are an example

Anonymous
Not applicable

vMinDate=Floor(MakeDate(2013));
Let vMaxDate=Floor(MakeDate(2013,10,31));
Let vNumDays=vMaxDate-vMinDate+1;

Calendar:

Load
TempDate as DateID,
Date(TempDate) As Date,
Year(TempDate) As Year,
Month(TempDate) As Month,
Date(MonthStart(TempDate), 'YYYY/MM') As YearMonth;



Load
RecNo()-1+$(vMinDate) As TempDate
AutoGenerate($(vNumDays));

Not applicable

In addition to the above posts, you can also refer to Qlikview 11 developers Book and Qlikview Cookbook by Rob Wonderlich which has got additional Features in Master Calendar Creation

-Ram