Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
How can I do this in Qlikview?
Thank you in advance.
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;
Thanks Christian for helping!!