Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Three dates into one date

Hi All,

I have to merge three dates into one date: order date, start date, and finish date and I have to merge all of these three dates into one date called the implementation date. I have been suggested master calender and canonical date. I am trying to use master calendar but it keeps running into an error.

Temp: 

Load 

               min(orderdate) as minDate, 

               max(orderdate) as maxDate 

Resident mytable; 

 

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

 

orderdateCalendar: 

Load 

               TempDate AS orderdate

               week(TempDate) As orderdateWeek, 

               Year(TempDate) As orderdateYear, 

               Month(TempDate) As orderdateMonth, 

               Day(TempDate) As orderdateDay, 

               YeartoDate(TempDate)*-1 as orderdateCurYTDFlag, 

               YeartoDate(TempDate,-1)*-1 asorderdateLastYTDFlag, 

               inyear(TempDate, Monthstart($(varMaxDate)),-1) as orderdateRC12, 

               date(monthstart(TempDate), 'MMM-YYYY') as orderdateMonthYear, 

               ApplyMap('QuartersMap', month(TempDate), Null()) as orderdateQuarter, 

               Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as orderdateWeekYear, 

               WeekDay(TempDate) as orderdateWeekDay 

Resident TempCalendar 

Order By TempDate ASC; 

Drop Table TempCalendar; 

Thanks in advance,

11 Replies
Not applicable
Author

Thanks Onno Van and Marco for your help and time. It was an issue at the qualify and unqualify level since I am dealing with multiple QVD tables.

oknotsen
Master III
Master III

Qualify? Classic !

Not sure what qualify and multiple QVD tables have to do with each other.

May you live in interesting times!