Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 Loaded | Total |
6/26/2020 | 9,060,501 |
6/27/2020 | 10,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 Loaded | Total |
6/27/2020 | 10,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 ;
Hi,
Aren't you missing the 'lib://DataConnection/' part before the QVD file name?
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.
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 ;