Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all
I have a following attached data two sheets
I want to perform the Incremental load
but I don't have date field
how to perform this? can anyone help me on this?
Sample is attached
u don"t need a Date field to perform incremental load; only a UNIQUE ID field is mandatory.
It would be sthing like:
1) Load everything the first time and store it into a QVD:
Table:
Load * from source;
store Table into table.qvd(qvd);
2) Once the first store done; comment ur script and change it as follow:
Table:
Load * from source;
concatenate(Table)
Load * from table.qvd where not exists(ID) ; // import from the QVD only the Data that does not exist in ur new source .
// with this, ur new Table will contain the new source + updated qvd.
//store the new table in the same qvd:
store Table into table.qvd(qvd);
hope that was clear..
If you have and incrementing ID field and insert only rows, you can use the ID field as a filter:
WHERE ID > lastid // you have calculated lastid from the QVD
-Rob
is this correct way?
first I loaded the first data and stored in qvd . and I loaded that qvd and wrote the not exists id
and loaded second excel where new data available and concatenated.
a:
LOAD ID,
Type,
Direction,
Category,
Name,
Amount
FROM
(qvd) where not Exists(ID) ;
Concatenate (a)
LOAD ID,
Type,
Direction,
Category,
Name,
Amount
FROM
(ooxml, embedded labels, table is Sheet2)
;
STORE a into D:\Inc.qvd;
exit SCRIPT;
You have to reverse the load order;
1) we import the new data from the excel
2) we import from the qvd the old data that does not exist in the excel (to update)
3) store everything in the qvd
a:
LOAD ID,
Type,
Direction,
Category,
Name,
Amount
FROM
(ooxml, embedded labels, table is Sheet2)
;
Concatenate (a)
LOAD ID,
Type,
Direction,
Category,
Name,
Amount
FROM
(qvd) where not Exists(ID) ;
STORE a into D:\Inc.qvd;
exit SCRIPT;