7 Replies Latest reply: Dec 27, 2017 4:28 AM by aravind reddy RSS

    Master Calendar "Field 'a' not found" Error

    aravind reddy

      Hi Community people. I tried to create a master calendar in Qlikview. But i'm getting an error as "Field 'a' not found" when i reload. have a look at my script which i mentioned below.and suggest me corrections.

       

      OrderHeader:

      LOAD OrderDate,

           OrderID,

           ProductID,

           Quantity,

           Sales,

           Discount,

           CostOfSales,

           GrossProfit,

           DeliveryDate

      FROM

      [C:\Users\ssecpl\Documents\QlikFiles\Ex4Mastercalender.xlsx]

      (ooxml, embedded labels, table is Sheet1);

       

      MinMaxDates:

      LOAD

      min(OrderDate) as minDate,

      max(OrderDate) as maxDate

      Resident OrderHeader;

       

       

       

      Let vMinDate = Num(Peek(‘minDate’,0,’MinMaxDates’));

      Let vMaxDate = Num(Peek(‘maxDate’,0,’MinMaxDates’));

      DROP table MinMaxDates;

       

       

      DateRanges:

      Load

      $(vMinDate) + IterNo()-1 as DateNum,

      Date($(vMinDate) + IterNo()-1) as TempDate

       

       

      Autogenerate 1 while $(vMinDate) + IterNo()-1 <= $(vMaxDate);

       

       

      MasterCalender:

      load TempDate as OrderDate,

      Day(TempDate) as Master.Day,

      Week(TempDate) as Master.Week,

      Month(TempDate) as Master.Month,

      'Q'& Ceil( Month(TempDate)/3) as Master.Quarter,

      Year(TempDate) as Master.Year

      Resident DateRanges order by TempDate asc;

      DROP table DateRanges;