Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
You INV_DATE might not have been read as date. May be look here for how to read dates in the right manner
Hi Sunny,
Thanks for reply. So I convert the INV_DATE to date using syntax = Date(Date#([INV_DATE],'YYYYMMDD'),'DD/MM/YYYY') as [INV_DATE], and then load the data but the error still there.
Please advise.
Many Thanks,
Dian