Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
Here you are an example
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));
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