3 Replies Latest reply: Jul 27, 2010 8:30 AM by didakuss RSS

    Error encountered during online Training course

    didakuss

      Hi, since I am new to Qlikview I started with the online training courses. Everything seemed to go fine until I ran into an error in the course: Developer 1 Version 9 module 8 - Time and dates in Qlikview.

      I managed to get to the part of the MasterCalendar, but when I run the script I get this message:

       

      *********************************

      Error in expression:

      ')' expected

      MasterCalendar:

      LOAD

      TempDate AS OrderDate,

      Week (TempDate) AS Week,

      Year (TempDate) AS Year,

      Month (TempDate) AS Month,

      Day (TempDate) AS Day,

      Weekday (TempDate) AS WeekDay,

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

      Date( Monthstart (TempDate), 'MMM-YYYY') AS MonthYear,

      Week (TempDate) & '-' & Year (TempDate) AS WeekYear,

      Inyeartodate (TempDate, , 0)*-1 AS CurYTDFlag,

      Inyeartodate (TempDate, , -1)*-1 AS LastYTDFlag

      Resident TempCalendar

      Order by TempDate ASC



      ****************************

      I just can't seem to find what is wrong. I thought I had it exactly as the course?! Can anyone see what I am doing wrong?

      Kind regards, Diego

       

       

        • AW:Error encountered during online Training course
          Martina Brenner

          hi,

          at the end I miss the semicolon ;

            • AW:Error encountered during online Training course
              didakuss

              Hi Martina,

              Sorry for the confusion. I actually posted the error message. My script, including the semi colon looks like this:

              LET VarMinDate = Num(Peek ('OrderDate',0,'Orders'));
              LET VarMaxDate = Num(Peek ('OrderDate',-1,'Orders'));
              LET VarToday = Num(Today());

              //************Temporary Calendar Table************
              TempCalendar:
              LOAD
              $(VarMinDate) + rowno() -1 AS DateNumber,
              date ($(VarMinDate) + rowno() -1) AS TempDate
              AUTOGENERATE
              $(VarMaxDate) - (VarMinDate) +1;

              //***********Master Calendar Table**************
              MasterCalendar:
              LOAD
              TempDate AS OrderDate,
              Week (TempDate) AS Week,
              Year (TempDate) AS Year,
              Month (TempDate) AS Month,
              Day (TempDate) AS Day,
              Weekday (TempDate) AS WeekDay,
              'Q' & Ceil(Month (TempDate)/3) AS Quarter,
              Date( Monthstart (TempDate), 'MMM-YYYY') AS MonthYear,
              Week (TempDate) & '-' & Year (TempDate) AS WeekYear,
              Inyeartodate (TempDate, $(varToday), 0)*-1 AS CurYTDFlag,
              Inyeartodate (TempDate, $(varToday), -1)*-1 AS LastYTDFlag
              Resident TempCalendar
              Order by TempDate ASC;

              Drop Table TempCalendar;

            • Error encountered during online Training course
              Oleg Troyansky

              I think your syntax problem resides here:

               


              didakuss wrote:
              Inyeartodate (TempDate, , 0)*-1 AS CurYTDFlag,
              Inyeartodate (TempDate, , -1)*-1 AS LastYTDFlag


              Function InYearToDate() requires that both dates are filled out. I suspect that you should have a variable like vToday as the second parameter, but it looks like the Variable value was not populated. You need to either fix the calculation of the variable or simply add function today() as the second parameter after TempDate.

              good luck!