Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 :
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