Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Incremental load

Hi,

Anybody can help me on setting Incremental load on the below query.

I dont want to reload the old data every time I clcik on reload..

I want just the new data to be added.

Thanks

LOAD  Distinct

     CallID,

     OriginalParty,

FROM

The X directory receives new log files every 15 minutes and I want just to load the new files and add them.

12 Replies
Not applicable
Author

LOAD  Distinct

CallID,

OriginalParty,

FROM

////////////////////////////////////////////Make it QVD File

CDR_Temp:
LOAD  Distinct

CallID,

OriginalParty,


FROM


Store CDR into CDR_Temp.QVD;
Drop Table CDR_Temp;

//////////////////////////////////////then it will read first the QVD File, next concatenate it
////////////////////////////////////// to the new data


CDR_updated:
LOAD  Distinct

CallID,

OriginalParty,


FROM ..\\cdr.Qvd;


Concatenate

LOAD  Distinct

CallID,

OriginalParty,


Store CDR_updated into CDR_Temp.qvd;        ////////////Then Rename the new updated file like
Drop Table CDR_updated;                     ///////////CDR_Temp.Qvd   this is the updated file                                                 ///////////that your final application will read
///////////every time you want to update, reload the                                             ///////////processs

I hope it helps!!

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Assuming these are text files, just add a BUFFER prefix.

CdrTab:

BUFFER LOAD  Distinct

     CallID,

     OriginalParty,

FROM

;

New files will be added automatically. And new rows from old files will be added as well.

-Rob

http://robwunderlich.com

Not applicable
Author

Should I have all the first and the second loads?

it seems to me that I dont need the first load if I weant to store it in QVD.right?

Not applicable
Author

Rob,

this didn't work ..It still loading all the files again..

Not applicable
Author

Yes , you are right we don´t need the first table!!

Not applicable
Author

So my script should look like this:

CDR_Temp:
LOAD  Distinct

           CallID,

           OriginalParty,

FROM


Store CDR into CDR_Temp.QVD;
Drop Table CDR_Temp;

//////////////////////////////////////then it will read first the QVD File, next concatenate it
////////////////////////////////////// to the new data


CDR_updated:
LOAD  Distinct

           CallID,

           OriginalParty


FROM ..\\cdr.Qvd;


Concatenate

LOAD  Distinct

           CallID,

           OriginalParty


Store CDR_updated into CDR_Temp.qvd;        ////////////Then Rename the new updated file like
Drop Table CDR_updated;                  ///////////CDR_Temp.Qvd   this is the updated file                                                                                                            ///////////that your final application will read
                                                                  ///////////every time you want to update, reload the processs

right?

I am just trying to make sure before I reload beause it takes about 10 hours to finish the load.

Not applicable
Author

Also what if I have a where statement after the load?

how it can be added after the second load from QVD?

Thanks

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It will load all the files the first time the BUFFER is run. Then after that it will appear to read the files -- but it really just checking filetime & size, which is very fast -- and then gets the data from the local BUFFER. It will reread all the physical files when:

1. The LOAD statement changes.

2. The script is moved to a new machine where the BUFFERed QVD doesn't exist.It will thenget created on first load.

-Rob

Not applicable
Author

CDR_Temp_History:
LOAD  Distinct

CallID,

OriginalParty,

FROM

                                  ////// this is the history table


Store CDR into CDR_Temp.QVD;
Drop Table CDR_Temp;

CDR_Temp:
LOAD  Distinct

CallID,

OriginalParty,

FROM ..\\cdr.Qvd;                                                               ////// this is the history table in QVD


Concatenate

LOAD  Distinct

CallID,                                                    ////// this is the updated table in excell or whatever is your case

OriginalParty

FROM CDR_Update.XLS;

Store  CDR_Temp into CDR_Temp_History;        ///// Now this new file is the one your final application will read.

Drop Tble CDR_Temp;