Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Incremental Update question

I have the following Script (sourced from the forums) as an example:

Let ThisExecTime = ReloadTime();

QV_Table:

SQL SELECT PrimaryKey, X, Y FROM DB_TABLE

WHERE ModificationTime >= #$(LastExecTime)#

       AND ModificationTime < #$(ThisExecTime)#;

Concatenate LOAD PrimaryKey, X, Y FROM File.QVD

WHERE NOT EXISTS(PrimaryKey);

Inner Join SQL SELECT PrimaryKey FROM DB_TABLE;

If ScriptErrorCount = 0 then

  STORE QV_Table INTO File.QVD;

  Let LastExecTime = ThisExecTime;

End If

My question is now: What if my PrimaryKey is 2 columns? How would I be able to do that? We have 4 financial databases that could have invoice numbers that are the same across all 4, when I load my data into the data warehouse, I include the name of where it's from in a seperate column.

I'd like to do an incremental update now as the records updates. The code doing this to the data warehouse is already done, and I'm busy with the QVW now, but would need to work with two "PrimaryKey"'s if at all possible.

any help would be appreciated!

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Create a composite key in the form key1&'-'&key2 AS compositekey.

This format can also be used in the where exists() clause.

Jonathan

View solution in original post

1 Reply
Anonymous
Not applicable
Author

Create a composite key in the form key1&'-'&key2 AS compositekey.

This format can also be used in the where exists() clause.

Jonathan