Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
simone_g
Contributor II
Contributor II

Partial Reload with yearly data

Hi all!
I need help with partial reload in Qlikview. I have a separate .qvd file for each year (i.e. 2021,2022,2023). I currently reload all the data every time:

 

SalesData:
LOAD 

date,
sales

from [Sales_*.qvd] (qvd);

 

To speed up the process, during partial reload, I would like to:

  1. keep the previous years in memory (i.e. 2021,2022)
  2. drop all the data of the current year (2023)
  3. reload the updated data of 2023

How can I do this in Qlikview?
Thank you in advance.

Labels (2)
2 Replies
cristianj23a
Partner - Creator III
Partner - Creator III

Hello, what you can do first is save your data in a QVD file and then put a condition where it says that if there is a qvd file, you must load it with the current year and then concatenate it to the qvd with the previous data (previously loaded), for last replaces the old QVD file.

Here an example code:

// Step 1: Load the table and save it to a QVD
MyTable:
LOAD
*
FROM [Path\To\Your\Source\File.xlsx]
(ooxml, embedded labels, table is Sheet1);

// Step 2: Check if there's an existing QVD for the table
Let vQvdPath = 'Path\To\Your\QVDs\' & 'MyTable.qvd';
If FileExists(vQvdPath) then
// Step 3: Load the new data with a condition for the current year
NewData:
LOAD
*
FROM [Path\To\Your\Source\File.xlsx]
(ooxml, embedded labels, table is Sheet1)
Where Year = Year(Today());

// Step 4: Concatenate the new data with the previously loaded QVD
Concatenate (MyTable)
LOAD
*
FROM [$(vQvdPath)] (qvd);

// Step 5: Save the updated data back to the QVD
Store MyTable into [$(vQvdPath)] (qvd);

else
// Step 6: If there's no existing QVD, load the entire table
MyTable:
LOAD
*
FROM [Path\To\Your\Source\File.xlsx]
(ooxml, embedded labels, table is Sheet1);

// Step 7: Save the entire table to the QVD for future incremental loads
Store MyTable into [$(vQvdPath)] (qvd);

endif;

 

 

https://www.linkedin.com/in/cristianjorge/
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.
Herrera43
Contributor
Contributor

Thanks Christian for helping!!

Social Security COLA