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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

Problem regarding Modification time Variable in Incremental load ..

HEy,

I tried to do incremental load by comparing Modification time of my excel sheet with last execution time of my excel sheet : :

My script is :

----------------------------------------------------------------------------------

Directory;

LET vModifiedTime = FileTime('C:\Users\nikhil.garg\Desktop\Disaster_Data\[Copy of Disaster.xlsx]');

LOAD *

FROM

[Disaster_Data\Copy of Disaster.xlsx]

(ooxml, embedded labels, table is Disaster) where vModifiedTime >= $(LastExecTime);

Concatenate

LOAD Id,

     StartDate,

     EndDate,

     Country,

     Type,

     Sub_Type,

     Name,

     Killed,

     Injured,

     Year

FROM

disaster1.qvd (qvd) WHERE NOT Exists(Id);

------------------------------------------------------------------------------------------

Error is :

1 Reply
Colin-Albert
Partner - Champion
Partner - Champion

The where clause is looking for a column in your spread sheet named vModifiedTime and is then looking to only load rows where the value of that column is greater than $(LastExecTime).

Your spread sheet does not have a column named vModifiedTime hence the error.

Try an IF statement

Directory;

LET vModifiedTime = FileTime('C:\Users\nikhil.garg\Desktop\Disaster_Data\[Copy of Disaster.xlsx]');

if $( vModifiedTime) >= $(LastExecTime then

     LOAD *

     FROM

     [Disaster_Data\Copy of Disaster.xlsx]

     (ooxml, embedded labels, table is Disaster) ;

     Concatenate

     LOAD Id,

          StartDate,

          EndDate,

          Country,

          Type,

          Sub_Type,

          Name,

          Killed,

          Injured,

          Year

     FROM

     disaster1.qvd (qvd) WHERE NOT Exists(Id);

endif ;  //if $( vModifiedTime) >= $(LastExecTime