Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
elenarelinque
Creator
Creator

Incremental load

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);

 

1 Reply
Anil_Babu_Samineni

@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.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful