Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Crichter141
Contributor III
Contributor III

Trouble Following Incremental Load instructions

So I'm trying to follow the instructions for Insert, Update and Delete found here:

https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/LoadData/use-QVD-files-i...

When I load my script, only the incremental load rows are coming through.  I think it's doing an inner join based only on the incremental load table limiting the result to just the new rows.

Here's Qlik's Code:

QV_Table:

SQL SELECT PrimaryKey, X, Y FROM DB_TABLE

WHERE ModificationTime >= #$(LastExecTime)#

AND ModificationTime < #$(ThisExecTime)#;  --I get 5,633 rows here, incremental table

 

Concatenate LOAD PrimaryKey, X, Y FROM [lib://DataFiles/File.QVD]

WHERE NOT EXISTS(PrimaryKey);  --I get 5,005,986 rows here, primary data table

 

Inner Join SQL SELECT PrimaryKey FROM DB_TABLE;

 

If ScriptErrorCount = 0 then

STORE QV_Table INTO [lib://DataFiles/File.QVD];

Let LastExecTime = ThisExecTime;

End If

 

The end result is only 5,633 rows, when I expect 5633 + 5005986 or 5,011,649.

Is there something I can do to tweak this?  I really need the total table, not just a piece of it.

 

Labels (2)
1 Solution

Accepted Solutions
Crichter141
Contributor III
Contributor III
Author

So here's my update.  The issue was the SQL command.  We originally tried to create a primary key (concatenated fields) in Qlik Sense.  Once I moved the Key back into our data warehouse, the code runs fine.  I believe the issue was with the SQL syntax we had used to make our key.  Thank you everyone!

View solution in original post

3 Replies
PrashantSangle

yes it is because of inner join.. 

why you need that inner join code in your script? (bold / highlighted one)

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Crichter141
Contributor III
Contributor III
Author

Thanks for replying.  I believe it's to drop the deleted records that exist in the Database.

Crichter141
Contributor III
Contributor III
Author

So here's my update.  The issue was the SQL command.  We originally tried to create a primary key (concatenated fields) in Qlik Sense.  Once I moved the Key back into our data warehouse, the code runs fine.  I believe the issue was with the SQL syntax we had used to make our key.  Thank you everyone!