Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
rahulsingh12
Contributor III
Contributor III

Calendar in Qlikview

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

3 Replies
vishsaggi
Champion III
Champion III

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');

ankur_abhishek
Contributor III
Contributor III

HI Rahul,

You can use a master calendar and use min and max date field from

the table . Use below link create Calendar.

How to create a Calendar

Thanks & Regards

Ankur

Kushal_Chawda