2 Replies Latest reply: Aug 31, 2016 11:31 AM by Dian Yulianti RSS

    Create Master Calendar Error

    Dian Yulianti

      Hi ,

       

      I am New in Qlik sense. I am Using Qlik Sense 3.0. I Load  data using data loader editor from csv files and create Master Calender using script. when load csv files no error, but when qlik sense run master calendar errors occur.

       

      This The Error

       

      Started loading data

      SalesToInvoice << sales_so

      Lines fetched: 4,471,684 QuartersMap << AUTOGENERATE(12) Lines fetched: 12

      Temp << SalesToInvoice Lines fetched: 1

      The following error occurred:

      Field not found - <<=>

      The error occurred here:

      TempCalendar: LOAD + Iterno()-1 As Num, Date( + IterNo() - 1) as TempDate AutoGenerate 1 While + IterNo() -1 <=

      Data has not been loaded. Please correct the error and try loading again.

      This is My SalesToInvoice script

       

      SalesToInvoice:

       

      LOAD

          CABANG,

          CUSTOMER_NUMBER,

          CUST_SHIP_TO,

          CUST_SHIP_NAME,

          CUST_SHIP_ADDR,

          HEADER_ID,

          INV_LINE_AMOUNT,

          INV_TAX_VALUE,

          INV_DPP_AMOUNT,

          INV_DATE,

          INVENTORY_ITEM_ID,

          LINE_ID,

          LOADSHEET_ITEM_DESC,

          LOADSHEET_NO,

          LOADSHEET_QTY,

          NPB_DATE,

          NPB_NO,

          ORDER_CATEGORY_CODE,

          ORDER_NUMBER,

          ORDER_QTY,

          ORDER_QUANTITY_UOM,

          ORDER_STATUS,

          ORDER_TYPE,

          ORDER_VALUE,

          ORDERED_DATE,

          ORDERED_ITEM,

          PICK_ITEM_DESC,

          PICK_QTY,

          REQUESTED_QUANTITY_UOM,

          SALES_CHANNEL_CODE,

          SALESMAN_NAME,

          SHIPPED_QUANTITY,

          SO_LINE,

          TAX_VALUE,

          PLR,

          PLR_1,

          UNIT_LIST_PRICE,

          UNIT_SELLING_PRICE,

          CUSTOMER_TRX_ID,

          OE_LINE_ID,

          OE_ORDER_NUMBER,

          QUANTITY_INVOICED,

          INVOICE_NUMBER,

          ORG_ID

      FROM [lib://acak2/sales_so.csv]

      (txt, codepage is 1252, embedded labels, delimiter is ',', msq);

       

       

      This is My calendar Script :


      QuartersMap: 
      MAPPING LOAD  
      rowno() as Month, 
      'Q' & Ceil (rowno()/3) as Quarter 
      AUTOGENERATE (12); 
      Temp: 
      Load 
                     min(INV_DATE) as minDate, 
                     max(INV_DATE) as maxDate 
      Resident SalesToInvoice; 
      Let varMinDate = Num(Peek('minDate', 0, 'Temp')); 
      Let varMaxDate = Num(Peek('maxDate', 0, 'Temp')); 
      DROP Table Temp; 
      TempCalendar: 
      LOAD 
                     $(varMinDate) + Iterno()-1 As Num, 
                     Date($(varMinDate) + IterNo() - 1) as TempDate 
                     AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate); 
      MasterCalendar: 
      Load 
                     TempDate AS INV_DATE, 
                     week(TempDate) As Week, 
                     Year(TempDate) As Year, 
                     Month(TempDate) As Month, 
                     Day(TempDate) As Day, 
                     YeartoDate(TempDate)*-1 as CurYTDFlag, 
                     YeartoDate(TempDate,-1)*-1 as LastYTDFlag, 
                     inyear(TempDate, Monthstart($(varMaxDate)),-1) as RC12, 
                     date(monthstart(TempDate), 'MMM-YYYY') as MonthYear, 
                     ApplyMap('QuartersMap', month(TempDate), Null()) as Quarter, 
                     Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYear, 
                     WeekDay(TempDate) as WeekDay 
      Resident TempCalendar 
      Order By TempDate ASC; 
      Drop Table TempCalendar; 

       

      Please Help,   I Don't know how to fix the error

       

      Regards,

       

      Dian