I'm about to create a calendar(see below) that will show when airplane lands and starts. I use a calendar but it is not sufficient when the user wants to see the number of landings / take-offs per hour. To make it even more complicated the user would be able to choose at the scheduled time and actual time. The mastercalendar works fine, but I want to get the hours too.
Both the planned time and actual time includes hh: mm: ss.
I hope that someone out there sitting on the solution or can link me to the forum there a solution exists.
LET StartDate = num(date(YearStart(AddMonths(Today(),-36,0)),'YYYY-MM-DD')); //LET EndDate = num(date(YearEnd(AddMonths(Today(),0,0)),'YYYY-MM-DD')); LET EndDate = num(date(today(),'YYYY-MM-DD')); LET CurrentDate=num(date(Today(),'YYYY-MM-DD')); LET CurrentYear=Year(Today()); LET LY_YTD=num(AddMonths(Today(),-12,0)); LET DaysToEnd=Monthend(Today())-Today(); //LET Today = date(today(),'YYYYMMDD');
DateIsland: LOAD *, Year(Date) AS [year], Month(Date) AS [month], num(Week(Date),00) as [week], Day(Date) AS [day], WeekDay(Date) AS [weekday], Date(Monthstart(Date),'MMM-YY') as [Year Month], // calculates YearMonth in the format MMM-YY Dual(WeekYear(Date)&'W'&num(Week(Date),00),WeekYear(Date)&num(Week(Date),00)) as [Year Week], Dual('Q'&Num(Ceil(Num(Month(Date))/3)),Num(Ceil(NUM(Month(Date))/3),00)) as [quarter],
if(InYear (Date, $(CurrentDate), -1),1) as _FULL_LY, if(InYear (Date, $(CurrentDate), 0),1) as _FULL_TY,
if(InYearToDate (Date, $(CurrentDate), 0),1) as _YTD_TY, if(InYearToDate (Date, $(CurrentDate), -1),1) as _YTD_LY, if(InQuarter (Date, $(CurrentDate), 0),1) as _FULL_TQ_TY, if(InQuarter (Date, $(LY_YTD), 0),1) as _FULL_TQ_LY, if(InQuarter (Date,$(CurrentDate), -1),1) as _FULL_PRQ,
if(InQuarterToDate (Date, $(CurrentDate), 0),1) as _QTD_TY,
if(InQuarterToDate (Date, $(LY_YTD), 0),1) as _QTD_LY, if(InQuarterToDate (Date,$(CurrentDate), -1),1) as _PR_QTD,
If( InMonth (Date, $(CurrentDate),0),1) as _FULL_TM_TY, If( InMonth (Date, $(CurrentDate),-12),1) as _FULL_TM_LY, If( InMonth (Date, $(CurrentDate), -1),1) as _FULL_PRM, If( InMonthToDate (Date, $(CurrentDate),0),1) as _MTD_TY,
If( InMonthToDate (Date, $(CurrentDate),-12),1) as _MTD_LY,
If( InMonthToDate (Date, $(CurrentDate), -1),1) as _PR_MTD,
// Week If( InWeek (Date, $(CurrentDate),0),1) as _FULL_TW_TY,
If( InWeek (Date, $(LY_YTD),0),1) as _FULL_TW_LY,
If( InWeek (Date, $(CurrentDate), -1),1) as _FULL_PRW, If( InWeekToDate (Date, $(CurrentDate),0),1) as _WTD_TY, If( InWeekToDate (Date, $(CurrentDate), -1),1) as _PR_WTD
//where exists(Date,Date) //Takes only dates in transtable alt. booking date in GL
; Load Date($(StartDate)+(Iterno()-1),'YYYY-MM-DD') as Date // Date, to be used as key feild to transactions
Autogenerate 1 While Date($(StartDate)+(Iterno()-1)) <=Date($(CurrentDate)) ;