Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Incremental load

Hi All,

Please find the attachment of the QVW file. My requirement is to implement the incremental load ( daily insert and update)

to accomplish this i tried with a excel file ...

it is working ...

My question is , If you look into my qVW file in the script  MAIN tab i have fetched the data from excel and stored into a particular location  and created QVD and i have commented the Main tab and wont use it any more

and in the second tab iam using that qvd file and using incremental last_update_date script then  again fetching the data from excel file and writing the WHERE condition (salesDate>'$(vLast_Update_Date)';

In my Database i have salesDate where daily 10000 recods will be updated ...

Now with the above logic will my script this has become one time increment load ? right ?

i need to know how can i make it daily update and insert ..

Expertise please do suggest ...

Thanks in Advance

1 Solution

Accepted Solutions
jyothish8807
Master II
Master II

Ya , that is correct. Since it is simple update so this logic should work

Best Regards,
KC

View solution in original post

3 Replies
jyothish8807
Master II
Master II

Try this:

//This should be one time load.

Sales:

LOAD

Country,

Division,

Sales,

PRoduct,

SalesDate

FROM

;

Store Sales into D:\salesQVD\sales.qvd(qvd);


// The above section should run only once, may be create a different layer or put a condition to check if QVD exists or not. After that your logic will work as expected as the variable value will be updated every time. Also added an additional store statement in the end.


Incremental:

LOAD

Country,

Division,

Sales,

PRoduct,

SalesDate

FROM

D:\salesQVD\sales.qvd(qvd);

Last_Updated_Date:

LOAD

max(SalesDate) as maxdate

Resident Incremental;

LET vLast_Updated_Date = Peek('maxdate',0,'Last_Updated_Date');

DROP Table Last_Updated_Date;

Concatenate (Incremental)

LOAD Country,

Division,

Sales,

PRoduct,

SalesDate

FROM

(ooxml, embedded labels, table is [Export Worksheet])

Where SalesDate > '$(vLast_Updated_Date)' ;

store Incremental into D:\salesQVD\sales.qvd(qvd);

Br,

KC

Best Regards,
KC
smilingjohn
Specialist
Specialist
Author

Thanks for the KC

so you mean to say that i need to create the qvd at the end and keep using the same qvd it keeps updating every time

right ?

...

jyothish8807
Master II
Master II

Ya , that is correct. Since it is simple update so this logic should work

Best Regards,
KC