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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

How to use incremental load for insert ??

Hey ,

Ia have loaded a excel sheet data and created a qvd also.

Now i want to use incremental load for the data that i inserted now.

Should i just copy and paste below code or i need to define modified date and last execute data nd all. ??

Please help...

SQL SELECT Id,  StartDate, EndDate, Country, Type, Sub_Type, Name, Killed, Injured, Year FROM Disaster

WHERE ModificationTime >= #$(LastExecTime)#;

Concatenate

LOAD Id, StartDate, EndDate, Country, Type, Sub_Type, Name, Killed, Injured, Year FROM Disaster1.QVD

WHERE NOT Exists(Id);

STORE Disaster INTO Disaster1.QVD;



Thanx.

13 Replies
avinashelite

Hi Nikhil,

Refer this PPT.

Not applicable

u should get this date from QVD (max exec date or max created date)  "LastExecTime",


which can u compare with the query as u did.


it will work fine!!!

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

It looks reasonable if you want to insert and update incrementally. If you create the variable LastExecTime correctly in the date format that your SQL database server expects then it should work. The new and the updated records are retrieved from the SQL source and concatenated with the historical records that were not updated.


talk is cheap, supply exceeds demand
Not applicable

nikhilgarg
Specialist II
Specialist II
Author

Hey,

Here i am using dummy data . I have entered some values in excel shet and name it : DIsaster.xlxs. It is saved on desktop.

Now i created qvd as : Disaster1.qvd and insert dummy record.

Now i want to use incremental load for updating data. I am using following code but it is generating error.

Please help :

Directory;

LOAD Id,

     StartDate,

     EndDate,

     Country,

     Type,

     Sub_Type,

     Name,

     Killed,

     Injured,

     Year

FROM

[Copy of Disaster.xlsx]

(ooxml, embedded labels, table is Disaster);

STORE Disaster into C:\Users\nikhil.garg\Desktop\disaster1.qvd

SQL SELECT Id,  StartDate, EndDate, Country, Type, Sub_Type, Name, Killed, Injured, Year FROM [Copy of Disaster.xlsx]

WHERE ModificationTime >= #$(LastExecTime)#;

Concatenate

LOAD Id, StartDate, EndDate, Country, Type, Sub_Type, Name, Killed, Injured, Year FROM Disaster1.QVD

WHERE NOT Exists[Id];

STORE Disaster INTO Disaster1.QVD;

nikhilgarg
Specialist II
Specialist II
Author

Can you please tell me in detail from where to get modified date and execute time ??

thanx

nikhilgarg
Specialist II
Specialist II
Author

HEy please solve my this issue .

I am having problem in incremental load.

I am using excel sheet dummy data stored on desktop. I created qvd file. Now i updated data and want incremental load. I have used following code. Please help me what to do :

Directory;

LOAD Id,

     StartDate,

     EndDate,

     Country,

     Type,

     Sub_Type,

     Name,

     Killed,

     Injured,

     Year

FROM

[Copy of Disaster.xlsx]

(ooxml, embedded labels, table is Disaster);

STORE Disaster into C:\Users\nikhil.garg\Desktop\disaster1.qvd ;

// Incremental load :

SQL SELECT Id,  StartDate, EndDate, Country, Type, Sub_Type, Name, Killed, Injured, Year FROM 'C:\Users\nikhil.garg\Desktop\Disaster_Data\[Copy of Disaster.xlsx]'

WHERE ModificationTime >= #$(LastExecTime)#;

Concatenate

LOAD Id, StartDate, EndDate, Country, Type, Sub_Type, Name, Killed, Injured, Year FROM C:\Users\nikhil.garg\Desktop\disaster1.qvd

WHERE NOT Exists[Id];

STORE Disaster INTO C:\Users\nikhil.garg\Desktop\disaster1.qvd;

nikhilgarg
Specialist II
Specialist II
Author

HEy lastExecution time variable is predefined. But to compare it modification time of table , how would i gte modification time ??

Not applicable

sry for late reply

***j4info****blogspot****in /2014/08/ qv5-incremental-loading.html

check above link and remove space before using above link from "08/ qv5  "