12 Replies Latest reply: Sep 8, 2014 3:41 AM by Thomas Oxenby RSS

    Help with Master calendar script error in the Qlik Tutorial

      I just tried the Qlik "Building an App" tutorial and found myself with a script error while creating the master calendar. Is it user error on my part, or is there indeed a typo in the tutorial. Any help in getting past this would be greatly appreciated. Here's the error message:


      Script line error: : TempCalendar: LOAD DATE( + ROWNO() -1) AS TempDate AUTOGENERATE - +1

       

      And here's my script code that I copy/pasted from page 33 of "Qlik Sense Tutorial - Building an App.pdf"

      LET varMinDate = NUM(PEEK('Date',0,'Sales data'));

      LET varMaxDate = NUM(PEEK('Date',-1,'Sales data'));

      TempCalendar:

      LOAD

      DATE($(varMinDate) + ROWNO() -1) AS TempDate

      AUTOGENERATE $(varMaxDate) - $(varMinDate) +1;

      // Create the Master Calendar

      MasterCalendar:

      LOAD

      DATE(TempDate) AS Date,

      WEEK(TempDate) AS Week,

      YEAR(TempDate) AS Year,

      MONTH(TempDate) AS Month,

      DAY(TempDate) AS Day,

      INYEARTODATE(TempDate,'2014-03-31', 0) *-1 AS CYTDFlag,

      INYEARTODATE(TempDate,'2013-03-31',0) *-1 AS LYTDFlag,

      DATE(MONTHSTART(TempDate), 'MMM-YYYY') AS MonthYear,

      'Q' & CEIL(MONTH(TempDate)/3) AS Quarter,

      WEEK(TempDate)&'-'&YEAR(TempDate) AS WeekYear,

      WEEKDAY(TempDate) AS WeekDay

      RESIDENT

      TempCalendar

      Order BY

      TempDate ASC;

      DROP FIELD TempDate;