Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
anyone has a master calendar where I can plug in a start date and end date and generate master calendar with all possible fields such as quarter, month, year, year to date..etc..
Have you searched? You can get lot of Documents..
load
year(Date column) as Year,
Month(Date Column) as month,
WEEK(Date Column) as WEEK
DAY (Date Column) as DAY
'Q' & CEIL((MONTH)/3) AS QUARTER
THIS IS GENERAL CALENDAR IT USE IT OTHER WISE SEARCH IN QLIK COMMUNITY HAVE THE MASTER CALENDAR
Have you searched? You can get lot of Documents..
Hi,
Try the below one,
SET DateFormat='D/M/YYYY';
LET vMinDate = Num('01/01/2016');
LET vMaxDate = NUm('31/12/2016');
TempCalendar:
LOAD
$(vMinDate) + IterNo() - 1 as Num,
Date($(vMinDate) + IterNo() - 1) as TempDate
AutoGenerate
1 While $(vMinDate) + IterNo() -1 <= $(vMaxDate);
MasterCalendar:
LOAD
TempDate as Date,
Week(TempDate) as Week,
Year(TempDate) as Year,
Month(TempDate) as Month,
Day(TempDate) as Day,
Weekday(TempDate) as WeekDay,
'Q' & ceil(month(TempDate) / 3) as Quarter,
'Q' & Ceil(Month(TempDate)/3) & '-' & Year(TempDate) as QuarterYear,
MonthName(TempDate) as MonthYear,
Week(TempDate)&'-'&Year(TempDate) as WeekYear
Resident TempCalendar
Order By TempDate ASC;
DROP Table TempCalendar;
Try the above logic
Hi Alec,
Default code for Master Calendar
Let VarMinDate = Num(Peek('OrderDate',0,'OrdersQuery'));
LET VarMaxDate = num(peek('OrderDate', -1, 'OrdersQuery'));
LET VarToday = num(Today());
TempCalendar:
LOAD
$(VarMinDate) + RowNo() -1 as DateNum,
Date($(VarMinDate) + RowNo()-1 ) as TempDate
AutoGenerate
$(VarMaxDate) - $(VarMinDate);
MasterCalendar:
LOAD
TempDate as OrderDate,
Week(TempDate) as Week,
Year (TempDate) as Year,
Month(TempDate) as Month,
Day(TempDate) as Day,
WeekDay(TempDate) as WeekDay
Resident TempCalendar;
DROP Table TempCalendar;