Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Michael_Tarallo
Employee
Employee

Working with Multiple Calendars - Qlik Live Stream Ep 4

Working with multiple calendars in Qlik can be tricky—but mastering it unlocks powerful insights across your data. In this session, you’ll learn how to manage and compare different date types such as order dates, ship dates, and invoice dates within the same app. We’ll explore how to create canonical date models, use link tables, and build visualizations that let you easily switch between calendar contexts. By the end, you’ll understand when and why to use multiple calendars and how to ensure your measures and trends stay accurate, consistent, and meaningful across every view.

Sample App and data attached below

Other helpful resources:

Improved Master Calendar Script Template courtesy: Rob Wunderlich 
(source: https://qlikviewcookbook.com/2015/05/better-calendar-scripts/)

Note - here you would change OrderDate to CanonicalDate - as the .qvf shows.

MasterCalendar: 
Load 
 TempDate AS OrderDate, 
 week(TempDate) As Week, 
 Year(TempDate) As Year, 
 Month(TempDate) As Month, 
 Day(TempDate) As Day, 
 'Q' & ceil(month(TempDate) / 3) AS Quarter, 
 Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYear, 
 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('OrderDate', recno()))-1 as mindate,
 max(FieldValue('OrderDate', recno())) as maxdate
AUTOGENERATE FieldValueCount('OrderDate');

 

Regards,
Mike Tarallo
Qlik
Labels (1)
1 Reply
F_B
Specialist II
Specialist II

Just a quick feedback: I find the Do More with Qlik channel extremely useful, and bringing all these tips together was definitely a great decision.