2 Replies Latest reply: Feb 10, 2014 8:16 AM by Srikanth P RSS

    Replace load

    Mark Munich

      What is replace load, when do we use it ?

        • Re: Replace load
          Massimo Grossi

          from online help

           

          "

          The replace prefix can be added to any Load, Select (SQL) or Map ... using statement in the script. The replace load/replace select statement has the effect of dropping the entire QlikView table, for which a table name is generated by the replace load/replace select statement, and replacing it with a new table containing the result of the replace load/replace select statement. The effect is the same during Partial Reload and full reload. The replace map...using statement causes mapping to take place also during partial script execution.

          The syntax is:

          replace[only](loadstatement |selectstatement |map...usingstatement)

          where:

          only is an optional qualifier denoting that the statement should be disregarded during normal (non-partial) reloads.

          Examples:

          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.

          "

          • Re: Replace load
            Srikanth P

            Generally we can use REPLACE Load in Partial Reloads. Please check the Help file some more info.