Created
July 2, 2021 13:08
-
-
Save DarinLevesque/bf43e4e69a3a22cc806834ef4284fb5e to your computer and use it in GitHub Desktop.
Qlik Sense Master Calendar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment