Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
bushpalaamarnat
Creator
Creator

Incremental Load - field not found

I have two files with date 19 Jan 2018 and 26 Jan 2018, using incremental load concept created the following qlikview script. However,  the error message come as field Date_Load not found. Could you help.

The idea is every week, we get a file and want to upload the data into qlikview, as  the data gets refreshed every week and in qlikview, we want to see the status of inventory last week, this week and future estimate week.

Following is the script. Could you help.

ICR_allexcel:

LOAD

FILE_NAME,

     Day,

     Month,

     Year,

     Date_load,

     Week,

     Material,

     [Material Description],

     [Material Type],

     Category,

     [Inventory Volume],

     [Demand Volume (Eaches)],

     Brand,

     Variant,

     [Customer Loc],

     [Customer Location Description],

     [Customer Zone],

     [Supplier Loc],

     [Supplier Location Description],

     [Supplier Zone],

     [Corridor Status],

     DFC,

     [Min DFC],

     [Max DFC],

     [Safety Days Supply]

   

FROM

[..\Output_QVD\allexcels.qvd]

(qvd);

//Find last load date

Last_updated_date:

load max(Date_load) as Max_Dateload

resident ICR_allexcel;

//Store last modified date to a variable

Let Max_Dateload = peek('Max_Dateload',0,'Last_updated_date');

// Delete table

Drop table ICR_allexcel;

//Load incremental Data

ICR_incremental:

LOAD

     FileName() as FILE_NAME,

     Day(Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY'))    as Day,

Month(Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY'))                    as Month,

Year(Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY'))                     as Year,

Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY')       as Date_load,

Week,

     Material,

     [Material Description],

     [Material Type],

     Category,

     [Inventory Volume],

     [Demand Volume (Eaches)],

     Brand,

     Variant,

     [Customer Loc],

     [Customer Location Description],

     [Customer Zone],

     [Supplier Loc],

     [Supplier Location Description],

     [Supplier Zone],

     [Corridor Status],

     DFC,

     [Min DFC],

     [Max DFC],

     [Safety Days Supply]

FROM

[..\Data Extract\26 Jan 2018.xlsx]

(ooxml, embedded labels, table is Sheet1)

Where Date_load > $(Max_Dateload);

//Concatenate with QVD

ICR_AllExcels:

Concatenate

Load

FILE_NAME,

     Day,

     Month,

     Year,

     Date_load,

     Week,

     Material,

     [Material Description],

     [Material Type],

     Category,

     [Inventory Volume],

     [Demand Volume (Eaches)],

     Brand,

     Variant,

     [Customer Loc],

     [Customer Location Description],

     [Customer Zone],

     [Supplier Loc],

     [Supplier Location Description],

     [Supplier Zone],

     [Corridor Status],

     DFC,

     [Min DFC],

     [Max DFC],

     [Safety Days Supply]

   

FROM

[..\Output_QVD\allexcels.qvd](qvd);

Store ICR_incremental into allexcels.qvd(qvd);

drop table ICR_incremental;

1 Solution

Accepted Solutions
big_dreams
Creator III
Creator III

Hi,

Yes there is error in your script.

I don't see Date_load field in you base 26 Jan 2018.xlsx

You are deriving it using this expression

Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY') as Date_load


You can not use derived field directly in same load.


Try with below modification.

ICR_incremental:

LOAD

      FileName() as FILE_NAME,

     Day(Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY'))    as Day,

Month(Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY'))                    as Month,

Year(Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY'))                     as Year,

Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY')       as Date_load,

Week,

     Material,

     [Material Description],

     [Material Type],

     Category,

     [Inventory Volume],

     [Demand Volume (Eaches)],

     Brand,

     Variant,

     [Customer Loc],

     [Customer Location Description],

     [Customer Zone],

     [Supplier Loc],

     [Supplier Location Description],

     [Supplier Zone],

     [Corridor Status],

     DFC,

     [Min DFC],

     [Max DFC],

     [Safety Days Supply]

FROM

[..\Data Extract\26 Jan 2018.xlsx]

(ooxml, embedded labels, table is Sheet1)

Where Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY') > $(Max_Dateload);

Regards

View solution in original post

15 Replies
YoussefBelloum
Champion
Champion

Hi,

when you start to load only the first part of the script which is the last QVD, do you see the Date_load column ?

bushpalaamarnat
Creator
Creator
Author

hi, Yes, i can see.

bushpalaamarnat
Creator
Creator
Author

The error message is showing when the script is loading ICR_incremental table. that is not reading Date_load and showing error Date_Load not found

YoussefBelloum
Champion
Champion

Yes I understand, but I'm not seeing the issue here

bushpalaamarnat
Creator
Creator
Author

I have tried different options, how ever the error is still persistent. Could any one help.

zebhashmi
Specialist
Specialist

Are you putting Table name in 'xxxx' single quotation marks everywhere within Peek?

bushpalaamarnat
Creator
Creator
Author

//Store last modified date to a variable

Let Max_Dateload = peek('Max_Dateload',0,'Last_updated_date');

big_dreams
Creator III
Creator III

Hi,

Yes there is error in your script.

I don't see Date_load field in you base 26 Jan 2018.xlsx

You are deriving it using this expression

Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY') as Date_load


You can not use derived field directly in same load.


Try with below modification.

ICR_incremental:

LOAD

      FileName() as FILE_NAME,

     Day(Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY'))    as Day,

Month(Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY'))                    as Month,

Year(Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY'))                     as Year,

Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY')       as Date_load,

Week,

     Material,

     [Material Description],

     [Material Type],

     Category,

     [Inventory Volume],

     [Demand Volume (Eaches)],

     Brand,

     Variant,

     [Customer Loc],

     [Customer Location Description],

     [Customer Zone],

     [Supplier Loc],

     [Supplier Location Description],

     [Supplier Zone],

     [Corridor Status],

     DFC,

     [Min DFC],

     [Max DFC],

     [Safety Days Supply]

FROM

[..\Data Extract\26 Jan 2018.xlsx]

(ooxml, embedded labels, table is Sheet1)

Where Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY') > $(Max_Dateload);

Regards

stabben23
Partner - Master
Partner - Master

could it be as simple as this? Bold changes.

Date(Date(Date#(left(FileName(),11),'DD MMM YYYY'),'DD/MM/YY'))       as Date_load,