9 Replies Latest reply: Feb 25, 2016 3:53 PM by Chandni Bhowmick RSS

    Fiscal Week Start Date is showing arbitrary date

    Chandni Bhowmick

      Hi,

       

      Please see the script below for Calender Data:

       

       

      LET vDateMin = Num(MakeDate(2005,9,26));

      LET vDateMax = Num(MakeDate(2015,9,25));

      LET vDateToday = Num(Today());

       

      TempCalendar:

       

      LOAD

      $(vDateMin) + RowNo() - 1 AS DateNumber,

      Date($(vDateMin) + RowNo() - 1) AS TempDate

      AUTOGENERATE 1

      WHILE $(vDateMin)+IterNo()-1<= $(vDateMax);

       

      Calendar:

      LOAD

      Date(TempDate) AS CalendarDate,

      num(Date(TempDate)) AS numDate,

      WeekDay(TempDate) as WeekDay,

      Week(TempDate) AS CalendarWeek,

      Right(WeekName(TempDate,13,-2),2) as FiscalWeek,

      Year(TempDate) AS CalendarYear,

      num(Month(TempDate)) AS CalendarMonth,

       

      WeekStart(TempDate,00,-2) as FiscalWeekStartDate

       

      RESIDENT TempCalendar ORDER BY TempDate ASC;

       

       

      I am not sure where is 12/30/1899 coming from. Please help.

      calendar.png