Comment mettre en place le chargement incrémental ?

0
207

Etape 1 : Chargement initial (onglet 1)

nourriture:
LOAD id,
[Food Cat],
[Food item],
location,
date(lastupdate) as lastupdate
FROM
[C:\Users\EXODATA\Desktop\exemple.xls]
(biff, embedded labels, table is Feuil1$);

store nourriture into ‘nourriture.qvd’ (qvd);

// date max , (onglet 2) etape 2

max:
LOAD
lastupdate
FROM
[C:\Users\EXODATA\Desktop\nourriture.qvd]
(qvd);

Last_Update_Date:
load max(date(lastupdate)) as MaxDate
resident max;

let Last_Update_Date = peek(‘MaxDate’,0,’Last_Update_Date’);

//ETAPE 3

incremental: //nourriture:
LOAD id,
[Food Cat],
[Food item],
location,
date(lastupdate) as lastupdate
FROM
[C:\Users\EXODATA\Desktop\exemple.xls]
(biff, embedded labels, table is Feuil1$)
WHERE lastupdate >= ‘$(Last_Update_Date)’
;
Concatenate
LOAD id,
[Food Cat],
[Food item],
location,
lastupdate
FROM
[C:\Users\EXODATA\Desktop\nourriture.qvd]
(qvd)
where not Exists(id)
;

store incremental into ‘nourriture.qvd’ (qvd);

LEAVE A REPLY

Please enter your comment!
Please enter your name here