6 Replies Latest reply: Apr 30, 2014 9:12 AM by Anand Chouhan RSS

    Calendar Table not found. Same calendar as always

      I am using the same Calendar table i use in all my qvws, except this time I'm getting a 'Table not found' error and I can't work out why

       

      This is my calendar script

       

       

       

      Calendar:

       

      LET vDateMin = Num(MakeDate(2014,04,05));

      Let vDateMax = Floor(Today());

       

       

      Calendar:

      LOAD

      Date(TempDate) AS ActionTime,

       

      // Standard Date Objects

      Day(TempDate) AS CalendarDayOfMonth,

      WeekDay(TempDate) AS CalendarDayName,

      Week(TempDate) AS CalendarWeekOfYear,

      Month(TempDate) AS CalendarMonthName,

      'Q' & Ceil(Month(TempDate)/3) AS CalendarQtr,

      Year(TempDate) AS CalendarYr,

       

      // Calendar Date Names

      WeekName(TempDate) as CalendarWeekNumberAndYear,

      MonthName(TempDate) as CalendarMonthAndYear,

      QuarterName(TempDate) as CalendarQuarterMonthsAndYear,

       

      // Start Dates

      DayStart(TempDate) as CalendarDayStart,

      WeekStart(TempDate) as CalendarWeekStart,

      MonthStart(TempDate) as CalendarMonthStart,

      QuarterStart(TempDate) as CalendarQuarterStart,

      YearStart(TempDate) as CalendarYearStart,

       

      // End Dates

      DayEnd(TempDate) as CalendarDayEnd,

      WeekEnd(TempDate) as CalendarWeekEnd,

      MonthEnd(TempDate) as CalendarMonthEnd,

      QuarterEnd(TempDate) as CalendarQuarterEnd,

      YearEnd(TempDate) as CalendarYearEnd,

       

      // Combo Date Examples

      'Q' & Ceil(Month(TempDate)/3) & '/' & Year(TempDate) AS CalendarQuarterAndYear,

      Year(TempDate) & '/' & 'Q' & Ceil(Month(TempDate)/3) AS CalendarYearAndQuarter,

      //'Wed ' & DayStart(WeekStart(TempDate) + 3) as CalendarWednesdays,

       

      //Relative Dates

      Today() - TempDate as DaysAgo,

      (WeekStart(Today()) - WeekStart(TempDate))/7 as WeeksAgo,

      12*(Year(Today())-Year(TempDate)) + Month(Today()) - Month(TempDate) as MonthsAgo,

      MonthName(today()) as ThisMonth,

      MonthName(AddMonths(today(),-1)) as PrevMonth

       

       

       

      RESIDENT TempCalendar ORDER BY TempDate ASC;

       

      DROP TABLE TempCalendar;

        • Re: Calendar Table not found. Same calendar as always
          Anand Chouhan

          Update new check now

           

           

          Where is your TempCalendar code let me know.

           

           

          Add beow lines of code for TempCalendar above the Calendar table

           

          TempCalendar:

          LOAD

          date($(vDateMin)+IterNo()-1) AS Datefield,

          date($(vDateMin)+IterNo()-1) AS TempDate

          AUTOGENERATE (1)

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





          • Re: Calendar Table not found. Same calendar as always
            Nizam HM

            TempCalendar  IS MISSING


            • Re: Calendar Table not found. Same calendar as always
              Mohammed Mukram

              Dear Alex,

               

              i think you forget to include TempCalendar script.

              check the below script.

               

               

               

              LET vDateMin = Num(MakeDate(2009,1,1));

              LET vDateMax = Floor(MonthEnd(Today()));

              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,

               

              // Standard Date Objects

              Day(TempDate) AS CalendarDayOfMonth,

              WeekDay(TempDate) AS CalendarDayName,

              Week(TempDate) AS CalendarWeekOfYear,

              Month(TempDate) AS CalendarMonthName,

              'Q' & Ceil(Month(TempDate)/3) AS CalendarQuarter,

              Year(TempDate) AS CalendarYear,

               

              // Calendar Date Names

              WeekName(TempDate) as CalendarWeekNumberAndYear,

              MonthName(TempDate) as CalendarMonthAndYear,

              QuarterName(TempDate) as CalendarQuarterMonthsAndYear,

               

              // Start Dates

              DayStart(TempDate) as CalendarDayStart,

              WeekStart(TempDate) as CalendarWeekStart,

              MonthStart(TempDate) as CalendarMonthStart,

              QuarterStart(TempDate) as CalendarQuarterStart,

              YearStart(TempDate) as CalendarYearStart,

               

              // End Dates

              DayEnd(TempDate) as CalendarDayEnd,

              WeekEnd(TempDate) as CalendarWeekEnd,

              MonthEnd(TempDate) as CalendarMonthEnd,

              QuarterEnd(TempDate) as CalendarQuarterEnd,

              YearEnd(TempDate) as CalendarYearEnd,

               

              // Combo Date Examples

              'Q' & Ceil(Month(TempDate)/3) & '/' & Year(TempDate) AS CalendarQuarterAndYear,

              Year(TempDate) & '/' & 'Q' & Ceil(Month(TempDate)/3) AS CalendarYearAndQuarter,

              'Wed ' & DayStart(WeekStart(TempDate) + 3) as CalendarWednesdays

               

              RESIDENT TempCalendar ORDER BY TempDate ASC;

               

              DROP TABLE TempCalendar;

              • Re: Calendar Table not found. Same calendar as always
                Anand Chouhan

                Write like below

                 

                 

                 

                LET vDateMin = Num(MakeDate(2014,04,05));

                LET vDateMax = Floor(Today());

                 

                //Add below TempCalendar code like

                TempCalendar:

                LOAD

                date($(vDateMin)+IterNo()-1) AS Datefield,

                date($(vDateMin)+IterNo()-1) AS TempDate

                AUTOGENERATE (1)

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

                 

                And then Add

                 

                Calendar:

                LOAD

                Date(TempDate) AS ActionTime,

                 

                // Standard Date Objects

                Day(TempDate) AS CalendarDayOfMonth,

                WeekDay(TempDate) AS CalendarDayName,

                Week(TempDate) AS CalendarWeekOfYear,

                Month(TempDate) AS CalendarMonthName,

                'Q' & Ceil(Month(TempDate)/3) AS CalendarQtr,

                Year(TempDate) AS CalendarYr,

                 

                // Calendar Date Names

                WeekName(TempDate) as CalendarWeekNumberAndYear,

                MonthName(TempDate) as CalendarMonthAndYear,

                QuarterName(TempDate) as CalendarQuarterMonthsAndYear,

                 

                // Start Dates

                DayStart(TempDate) as CalendarDayStart,

                WeekStart(TempDate) as CalendarWeekStart,

                MonthStart(TempDate) as CalendarMonthStart,

                QuarterStart(TempDate) as CalendarQuarterStart,

                YearStart(TempDate) as CalendarYearStart,

                 

                // End Dates

                DayEnd(TempDate) as CalendarDayEnd,

                WeekEnd(TempDate) as CalendarWeekEnd,

                MonthEnd(TempDate) as CalendarMonthEnd,

                QuarterEnd(TempDate) as CalendarQuarterEnd,

                YearEnd(TempDate) as CalendarYearEnd,

                 

                // Combo Date Examples

                'Q' & Ceil(Month(TempDate)/3) & '/' & Year(TempDate) AS CalendarQuarterAndYear,

                Year(TempDate) & '/' & 'Q' & Ceil(Month(TempDate)/3) AS CalendarYearAndQuarter,

                //'Wed ' & DayStart(WeekStart(TempDate) + 3) as CalendarWednesdays,

                 

                //Relative Dates

                Today() - TempDate as DaysAgo,

                (WeekStart(Today()) - WeekStart(TempDate))/7 as WeeksAgo,

                12*(Year(Today())-Year(TempDate)) + Month(Today()) - Month(TempDate) as MonthsAgo,

                MonthName(today()) as ThisMonth,

                MonthName(AddMonths(today(),-1)) as PrevMonth

                RESIDENT TempCalendar ORDER BY TempDate ASC;

                 

                DROP TABLE TempCalendar;