Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
How do I create a calendar in qlikview in a table A having a date field.
I need to have a calendar from min and max of the date field in the table.
Regards,
Rahul
Try this?
In your InlineLoad create a keyfield like
LOAD *, Num(Floor(Yourdatefield)) AS %DateKey [
Field1, Field1, Yourdatefield
];
Calendar:
Load
Num(Floor(TempDate)) AS %DateKey,
'W' & week(TempDate) AS Week,
Year(TempDate) AS Year,
Month(TempDate) AS Month,
Day(TempDate) AS Day,
YeartoDate(TempDate)*-1 AS CurYTDFlag,
YeartoDate(TempDate,-1)*-1 AS LastYTDFlag,
//inyear(TempDate, Monthstart($(varMaxDate)),-1) AS RC12,
//date(monthstart(TempDate), 'MMM-YYYY') AS MonthYear,
'Q' & ceil(month(TempDate) / 3) AS Quarter,
Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) AS WeekYear,
Date(TempDate, 'MMM-DD') AS MonthDay,
WeekDay(TempDate) AS WeekDay
;
//=== Generate a temp table of dates ===
LOAD
date(mindate + IterNo()) AS TempDate,
maxdate // Used in InYearToDate() above, but not kept
WHILE mindate + IterNo() <= maxdate;
//=== Get min/max dates from Field ===/
LOAD
min(FieldValue('YourDateField', recno()))-1 AS mindate,
max(FieldValue('YourDateField', recno())) AS maxdate
AUTOGENERATE FieldValueCount('YourDateField');
HI Rahul,
You can use a master calendar and use min and max date field from
the table . Use below link create Calendar.
Thanks & Regards
Ankur