Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to do an incremental load. I have a table where only planned work hours from today onwards are stored, and the previous day's data is deleted the next day. I want to save day by day, but also, the data for the current day can be modified, and I want to update it in case of changes.
This is the script I am using:
LIB CONNECT TO 'SErverEMS (extrugal2_qlik2)';
// Load existing data from the QVD file (if any)
CalendarHistorico:
LOAD *
FROM [lib://Repositorio/Calendar_EMS.qvd] (qvd);
// Define the variable LastExecTime with the date and time of the last script execution
LET LastExecTime = ReloadTime();
// Load all data from the source table
Calendar:
LOAD *,
IF(TimeStampUpdate >= '$(LastExecTime)', 'Updated', 'Not Updated') AS Estado;
SQL SELECT IDGen,
"Date",
IDResource,
"Day",
CodHourKind,
"Month",
"Week",
IDUserCreation,
IDUserUpdate,
TimeStampCreation,
TimeStampUpdate,
IDDayKind,
IDResourceKind,
DescrDayKind,
"Year",
PercUsage,
"Log",
gIDResource,
CodResource,
CodResourceKind,
CodUserCreation,
CodUserUpdate
FROM Calendar
WHERE "Date" = Today() OR TimeStampUpdate >= '$(LastExecTime)';
// Perform an incremental load to update existing records
Concatenate (CalendarHistorico)
LOAD *
RESIDENT Calendar
WHERE Estado = 'Updated';
// Store the updated data into the QVD file
STORE Calendar INTO [lib://Repositorio/Calendar_EMS.qvd] (qvd);
@elenarelinque I used to follow this when I need DML operations in Qlik incremental load. How To Implement Incremental Load In QlikView? (analyticsvidhya.com)
Please check and see if that is helping for you.