Skip to main content Skip to complementary content

Replace

The Replace prefix can be added to any LOAD or SELECT statement in the script to specify that the loaded table should replace another table. It also specifies that this statement should be run in a partial reload. The Replace prefix can also be used in a Map statement.

Syntax:  

Replace[only][Concatenate[(tablename)]] (loadstatement | selectstatement)


Replace[only]mapstatement

 

During a normal (non-partial) reload, the ReplaceLOAD construction will work as a normal LOAD statement but be preceded by a DropTable. First the old table will be dropped, then records will be generated and stored as a new table.

If the Concatenate prefix is used, or if there exists a table with the same set of fields, this will be the relevant table to drop. Otherwise, there is no table to drop and the ReplaceLOAD construction will be identical to a normal LOAD.

A partial reload will do the same. The only difference is that there is always a table from the previous script execution to drop. The ReplaceLOAD construction will always first drop the old table, then create a new one.

The Replace Map...Using statement causes mapping to take place also during partial script execution.

Arguments:  

Replace arguments
Argument Description
only An optional qualifier denoting that the statement should be disregarded during normal (non-partial) reloads.

Examples and results:  

Examples and results
Example Result

Tab1:

Replace LOAD * from File1.csv;

During both normal and partial reload, the QlikView table Tab1 is initially dropped. Thereafter new data is loaded from File1.csv and stored in Tab1.

Tab1:

Replace only LOAD * from File1.csv;

During normal reload, this statement is disregarded.

During partial reload, any QlikView table previously named Tab1 is initially dropped. Thereafter new data is loaded from File1.csv and stored in Tab1.

Tab1:

LOAD a,b,c from File1.csv;

Replace LOAD a,b,c from File2.csv;

During normal reload, the file File1.csv is first read into the QlikView table Tab1, but then immediately dropped and replaced by new data loaded from File2.csv. All data from File1.csv is lost.

During partial reload, the entire QlikView table Tab1 is initially dropped. Thereafter it is replaced by new data loaded from File2.csv.

Tab1:

LOAD a,b,c from File1.csv;

Replace only LOAD a,b,c from File2.csv;

During normal reload, data is loaded from File1.csv and stored in the QlikView table Tab1. File2.csv is disregarded.

During partial reload, the entire QlikView table Tab1 is initially dropped. Thereafter it is replaced by new data loaded from File2.csv. All data from File1.csv is lost.

Learn more

 

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!

Join the Analytics Modernization Program

Remove banner from view

Modernize without compromising your valuable QlikView apps with the Analytics Modernization Program. Click here for more information or reach out: ampquestions@qlik.com