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

Incremental Load Append deleting previous results

I have a QVD.

Everyday, the data should run from SQL and insert in a "Snapshot" of that days data into the QVD.

I'd like the output in Qlik to show a table that shows the DATE loaded into the QVD, and the total SUM of the data.

Date LoadedTotal
6/26/20209,060,501
6/27/202010,788,040

 

However, when i run the Incremental Load script, I see that it overwrites the previous days snapshot and only shows me what i loaded in that day:

Date LoadedTotal
6/27/202010,788,040

 

Can you advise how to keep the records from the previous load?

DataTableSQL:

SQL

Select *, GETDATE() as SnapShotDate from temp.DataTable;

Concatenate Load * from QVDHistoryFile.QVD;

Store DataTableSQL into QVDHistoryFile.QVD;

Drop DataTableSQL ;

 

Labels (3)
5 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi,

Aren't you missing the 'lib://DataConnection/' part before the QVD file name?

kaitlynwagner_s
Contributor II
Contributor II
Author

It’s there in my code but I took it out of the example.
fosuzuki
Partner - Specialist III
Partner - Specialist III

Your sample code seems fine.

It would help if you put the real code, maybe there is some little difference which is causing the issue. It would also help if you put the reload log.

kaitlynwagner_s
Contributor II
Contributor II
Author

 
kaitlynwagner_s
Contributor II
Contributor II
Author

Thanks for the suggestion! Here is what I have:

LIB CONNECT TO 'Data_Reporting';

OutstandingKPI:

SQL

Select

el.Entity,
el.AccountCode ,
el.AccountName,
el.AccountName_ShortName,
el.AccountName_ShortName as AccountName_ShortName_Rep,
el.elmlevel,
el.Address,
el.City,
el.State,
el.Country,
el.Telephone,
el.Email,
CASE WHEN el.Country = 'US' and el.STATE in ('AL','FL','GA','IL','IN','KS','KY','LA','MI','MS','NE','OH','OK','SD','ND','TN','WI') then 'Z-MW'
WHEN el.Country = 'US' and el.STATE in ('CT','DC','DE','MA','MD','ME','NC','NH','NJ','NY','PA','RI','SC','VA','VT','WV') then 'Z-NE'
WHEN el.Country = 'US' and el.STATE in ('CA') then 'Z-CA'
WHEN el.Country = 'US' and el.STATE in ('AK', 'AR','AZ','CO','HI','IA','ID','MN','MO','MT','NM','NV','OR','TX','UT','WA','WY') then 'Z-WC'
else 'Other' end as Region,

SUM(el.Volume) as Volume,
GETDATE() as DataLoadDate

from dbo.CustomerActvity el ;

 

Concatenate LOAD * from [lib://Qlik_Resources/Outstanding_KPI_KW.qvd];

STORE OutstandingKPI INTO [lib://Qlik_Resources/Outstanding_KPI_KW.qvd] (qvd);

DROP TABLE OutstandingKPI ;