Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
renuka_sasikumar
Creator III
Creator III

Incremental Load : Delete & Update

Hi,

I am trying to implement Incremental Load for delete & update data fectching from Oracle, below the script

I hope this is the correct one, but the load is taking long time sometimes it completes at 15mins ssometime it takes more than 2 hour.

Can anyone help on this as it's really urgent for me.

MaxDate:

LOAD

Year(Max(LAST_UPDATE_DATE)) - 2  as Date,

Year(Max(LAST_UPDATE_DATE)) - 1  as Year2

FROM "C:\Qlikview\[XYZ].QVD"

(qvd);

Let vSunMaxYear = Peek('Date');

Let vNotSunMaxYear = Peek('Year2');

Drop Table MaxDate;

If WeekDay(Today()) = 'Sunday' THEN

SundayData:

LOAD  *

Where  Year(LAST_UPDATE_DATE ) >= $(vSunMaxYear);

SQL SELECT *

FROM "ABC"."XYZ";

Concatenate

LOAD *

FROM

"C:\Qlikview\[XYZ].QVD"

(qvd)

WHERE Year(LAST_UPDATE_DATE )< $(vSunMaxYear);

STORE SundayData INTO $(vSales_Raw_Extractor)\[XYZ].QVD(qvd);

DROP Table SundayData;

ELSE

NotSundayData:

LOAD  *

Where  Year(LAST_UPDATE_DATE )>= $(vNotSunMaxYear);

SQL SELECT *

FROM "ABC"."XYZ";

Concatenate

LOAD * FROM

"C:\Qlikview\[XYZ].QVD"

(qvd)

WHERE Year(LAST_UPDATE_DATE )< $(vNotSunMaxYear);

STORE NotSundayData INTO $(vSales_Raw_Extractor)\[XYZ].QVD(qvd);

DROP Table NotSundayData;

Regards,

Renuka S

11 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

I cant help with Oracle code - I have not had much need for it in the places I work. Perhaps someone else can help here, or go to the Oracle community site for more help..

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
renuka_sasikumar
Creator III
Creator III
Author

Hi Jonathan,

Thanks for your help, I got the answer for this. Below is the script.

MaxDate:

LOAD

Year(Max(LAST_UPDATE_DATE)) - 2  as Date,

Year(Max(LAST_UPDATE_DATE)) - 1  as Year2

FROM "C:\Qlikview\[XYZ].QVD"

(qvd);

Let vSunMaxYear = Peek('Date');

Let vNotSunMaxYear = Peek('Year2');

Drop Table MaxDate;

If WeekDay(Today()) = 'Sunday' THEN

SundayData:

SQL SELECT *

FROM "ABC"."XYZ"

where To_number(To_Char("LAST_UPDATE_DATE",'YYYY'),'9999')>=$(vSunMaxYear);

Concatenate

LOAD *

FROM

"C:\Qlikview\[XYZ].QVD"

(qvd)

WHERE Year(LAST_UPDATE_DATE )< $(vSunMaxYear);

STORE SundayData INTO $(vSales_Raw_Extractor)\[XYZ].QVD(qvd);

DROP Table SundayData;

ELSE

NotSundayData:

SQL SELECT *

FROM "ABC"."XYZ"

where To_number(To_Char("LAST_UPDATE_DATE",'YYYY'),'9999')>=$(vNotSunMaxYear);

Concatenate

LOAD * FROM

"C:\Qlikview\[XYZ].QVD"

(qvd)

WHERE Year(LAST_UPDATE_DATE )< $(vNotSunMaxYear);

STORE NotSundayData INTO $(vSales_Raw_Extractor)\[XYZ].QVD(qvd);

DROP Table NotSundayData;

Regards,

Renuka S