Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

How to create calendar in QV?

Please help me with script to creat calendar (Quater, Half year,Month,Year)

2 Replies
bhumika11
New Contributor II

Re: How to create calendar in QV?

SET STARTDATE = ’01-01-2006′; //fill in your start date
LET ENDDATE = date(today());
[TEMP_DATE]:
LOAD
date( date#(‘$(STARTDATE)’,'DD-MM-YYYY’)-1 + recno() ,’DD-MM-YYYY’) as DATE
AUTOGENERATE (date#(‘$(ENDDATE)’) – date#(‘$(STARTDATE)’))+1;
[DATETABLE]:
LOAD
DATE,
Year(DATE) as YEAR,
Month(DATE) as MONTH,
Week(DATE) as WEEK,
WeekDay(DATE) as WEEKDAY,
Day(DATE) as DAY,
Year(DATE) & right(’00′ & week(DATE),2) as YYYYWW,
Year(DATE) & right(’00′ & num(Month(DATE)),2) as YYYYMM,
Year(DATE) & ceil(num(Month(DATE))/3) as YYYYK,
‘Quarter’ & ceil(num(Month(DATE))/3) as QUARTER
RESIDENT [TEMP_DATE];

DROP TABLE [TEMP_DATE];

Community Browser