Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
LastUpdatedDate:
Load
max(Date("Date of Joining")) as MaxDate
FROM /*lib://QVDs/abc.qvd(qvd);*/ [lib://QVDs/Employee.xls]
(biff, embedded labels, table is Sheet1$);
Let varThisExec = Date(Now());
Let varLastExec = date(MaxDate);
drop table LastUpdatedDate;
if ('$(varTemp)'=1) then
Qvd:
LOAD
"First Name",
"Last Name",
"Date of Joining",
Designation,
Location,
Salary,
ID
FROM [lib://QVDs/Employee.xls]
(biff, embedded labels, table is Sheet1$)
Where "Date of Joining" > '$(varLastExec)';
Store Qvd into [lib://QVDs/abc.qvd](qvd);
Let '$(varTemp)'=0;
endif
Drop Table Qvd;
LastUpdatedDate:
Load max(Date("Date of Joining")) as QvdDate
FROM lib://QVDs/abc.qvd(qvd);
Let varQvdDate = date(QvdDate);
Temp:
LOAD
"First Name",
"Last Name",
"Date of Joining",
Designation,
Location,
Salary,
ID
FROM [lib://QVDs/Employee.xls]
(biff, embedded labels, table is Sheet1$)
Where "Date of Joining" > '$(varQvdDate)';
Concatenate
LOAD * from lib://QVDs/abc.qvd(qvd)
where not Exists(ID);
inner join
Load ID FROM [lib://QVDs/Employee.xls]
(biff, embedded labels, table is Sheet1$);
if ('$(ScriptErrorCount)') = 0 then
Store Temp into [lib://QVDs/abc.qvd](qvd);
Let varLastExec = '$(varThisExec)';
Let varQvdDate = '$(varThisExec)';
endif
After, Each execution of this script I want to reinitialize varLastExec date to current date.
Not sure I understand. The first part of your code overwrites varLastExec.This code is probably not working as I see a few issues. Can you clarify a little more what you are trying to do?
Jonathan, Actually what I want is, During the next reload of the script, I need varLastExec = varThisExec ( previous reloaded time).
As mentioned by Jonathan your script is not accurately formed.
Essentially a variable value is stored in the app after successful reload. So to get the previous variable value, simply grab it before it is overwritten.
LET varLastExec = varThisExec;
LET varThisExec = Today();
Also notice that Date(Now()) does not give you an accurate date value, it will be a timestamp containing date and time. This is likely to cause you logical issues when using the value in comparisons. Today() will return the current date, or use Now() it you are looking for the timestamp.