Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
My table is too big for one Qlik Sense dashboard to run in our production environment, therefore it needs to be split into QVD files for every two year period between 2002 and Year(Today()).
To achieve this, I am running a `for each` loop that would feed every other year value in this range into:
- a WHERE clause of the SQL query filtering by datetime (ISO8601).
- the STORE file path.
LET $(vYearList) = 2002:Year(Today();
for Each Year in $(vYearList)
LOAD STATEMENT;
SQL QUERY
WHERE datetime > ($(Year)-2)-01-01 and datetime < $(Year)-12-31
FROM DB;
Store TABLE into [lib://PATH_$(Year)_($(Year)-2).qvd](qvd);
It would take a while to setup the reprex, but any advice on how you would write this script is appreciated, even if it's just for every year.
I think I would slice the data yearly - maybe with:
for i = 2002 to year(today())
... // and $(i) is then your year-variable within the where clause and by the storing
next