8 Replies Latest reply: Aug 12, 2015 6:35 AM by vir vir RSS

    Want to create a master calendar from today to max date

    vir vir

      HI,

       

      I want to create a master calendar from today to maxdate as per requirement .Below the code i am using ....but its not showing right week filter ...kindly suggest

       

      LET vToday = Num(Today());

       

      MinMax:

      LOAD

        Min([Arrival Date]) as MinDate,

        Max([Arrival Date]) as MaxDate

      RESIDENT booking_f;

      //Let varMinDate = Num(Peek('MinDate',0,’MinMax’));

      //Let varMinDate = Num(Peek($(vToday)));

      Let varMaxDate = Num(Peek('MaxDate',0,’MinMax’));

       

       

       

       

      TempCalendar:

      Load

      $(vToday) + Iterno() -1 as Num,

      Date($(vToday) + Iterno() -1) as TempDate

      Autogenerate 1 while $(vToday) + Iterno() -1 <= $(varMaxDate);

       

       

      MasterCalendar:

      Load

      TempDate As [Arrival Date],

      Week(TempDate) As Week,

      weekday(TempDate) as WeekDay,

      Year(TempDate) As Year,

      Month(TempDate) As Month

      resident TempCalendar

      Order by TempDate ASC;

       

       

      drop table TempCalendar;