Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

FY into Existing Master Calendar

Hi All,

I am trying to add Financial Years into my existing Master Calendar and having done some browsing and reading it appears there are a few methods but I could not see one with the right answer

I want to maintain the calendar below but also want to add in FY as an extra option is this a possibility?

Toby

/////////////////////////////
// QLIKVIEW MASTER CALENDAR//
/////////////////////////////


QuartersMap: 
MAPPING LOAD  
rowno() as Month, 
'Q' & Ceil (rowno()/3) as Quarter 
AUTOGENERATE (12); 
 
 
Temp: 
Load 
              min(CMDBDate) as minDate,     //  <<<<<  Change Name of Date Field Here
              max(CMDBDate) as maxDate       //  <<<<<  Change Name of Date Field Here
Resident ReportView; 
 
Let varMinDate = Num(Peek('minDate', 0, 'Temp')); 
Let varMaxDate = Num(Peek('maxDate', 0, 'Temp')); 
DROP Table Temp; 


TempCalendar: 
LOAD 
               $(varMinDate) + Iterno()-1 As Num, 
               Date($(varMinDate) + IterNo() - 1) as TempDate 
               AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate); 
 
MasterCalendar: 
Load 
    TempDate AS CMDBDate,  //  <<<<<  Change Name of Date Field Here
    week(TempDate) As Week, 
    Year(TempDate) As Year, 
    Month(TempDate) As Month, 
    Day(TempDate) As Day, 
    WeekEnd(TempDate) as WeekEndDate,
    WeekStart(TempDate) as WeekStartDate,
    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, 
    ApplyMap('QuartersMap', month(TempDate), Null()) as Quarter, 
    Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYear, 
    WeekDay(TempDate) as WeekDay 
   
Resident TempCalendar 
Order By TempDate ASC; 
Drop Table TempCalendar; 

20 Replies
Not applicable
Author

Perfect, thank you once again for your time and patience