Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

incremental load, delete old field and replacing it with new field, same name

Dear all,

I have an incremental load running every week, which is just adding data on the bottom of the qvx.

it is my intention to add a flag field, in order to detect which data is the most recent one, so to easily make some selections in the qvw.

Therefore I thought of the following:

Loading the new data from the server, adding a field and populating it with 1s

Loading then the "old" data from the qvx, dropping the field (so I get rid of the 1s from the previous week) and ultimately append to this the freshly loaded data from the server (with the 1s)

But "of course" it goes wrong, as when I drop the field with the 1s, it drops also the newly created one from the server...

here is the script:

Master:

LOAD

*,

Today() AS DayStamp,

1 as LatestMaster;

SQL SELECT *

FROM SERVER.GOAM;

LOAD *

FROM \\folder\Master.qvx (qvx);

DROP FIELD LatestMaster;

STORE Master INTO \\folder\Master.qvx (qvx);

Much appreciated if you can help me out here; though I an thinking that probably I am going a long way to simply be able to select the values with the latest DayStamp...

thank you!

1 Reply
sbaldwin
Partner - Creator III
Partner - Creator III

Hi, i think you are basically there all you need to do is not try and store all of the fields into your qvx, lets say you have columns named col1 and col2 in your GOAM table, try the below:

Thanks

Steve

Master:
LOAD
col1,col2,
Today() AS DayStamp,
1 as LatestMaster;
SQL SELECT *
FROM SERVER.GOAM;

concatenate (Master)
LOAD col1,col2
FROM \\folder\Master.qvx (qvx);

STORE col1,col2 from Master INTO \\folder\Master.qvx (qvx);