I have a table in my db that has a composite primary key, it´s formed by local, document number and document type. Now, i realized a incremental load by date, but some days i havent some local information so i got to do this load manually, in another qvw.
My script looks like:
SET
vQVD_File = C:\QlikView\QVD\Tabla.qvd;
Temp_Tabla:
NoConcatenate
LOAD
*
From
$(vQVD_File) (qvd);
Max_Fecha:
NoConcatenate
Load
fech_docum resident Temp_Tabla
order
by fech_docum DESC;
LET
vUltFecha = Peek('fech_docum', 0);
LET
vUltFecha = chr(39)&Left(vUltFecha, 10)&chr(39);
Tabla:
Load
codi_local,
codi_docum,
nume_docum
fech_docum,
...;
SELECT
codi_local,
codi_docum,
nume_docum
fech_docum,
...from...
where
fech_docum > $(vUltFecha)
;
CONCATENATE (Temp_Tabla) LOAD * RESIDENT Tabla;
drop table Tabla;
store * from Temp_Tabla into C:\QLIKVIEW\QVD\CargaDaypart.qvd;
ENDIF
drop table Temp_tabla;
drop table Max_Fecha;
And the load by local is similar except by this include the condition Codi_local in ( $(vCodi_local))
My question is how can i do to make the incremental load by local, document number and document type on a optimized way or automatic if it´s possible without the load of this camps from my QVD, even if i had to.