3 Replies Latest reply: May 12, 2017 5:30 AM by Rohan Shetty RSS

    Incremental Load script error

    Florian Pfaffl

      Hey,

       

      I'm trying to implement incremental loading from SQL to QVD.

       

      I built an initial load writer (QVD_Writer_Bewegungen2.qvw) that works fine and gives me a QVD-File called 'BEWEGUNGEN2'.

      --------------------------------------------------------------------------

      V_QLIK_BEWEGUNGEN2:

       

      SQL SELECT *

      FROM TEXAS.V_QLIK_BEWEGUNGEN2

      WHERE    BEW_BEWEGUNGSTAG>= '$(Start_Zeitraum)' //Start of Data

      ;

       

      store V_QLIK_BEWEGUNGEN2 into '..\QVD\V_QLIK_BEWEGUNGEN2.qvd' (qvd);

       

      drop table V_QLIK_BEWEGUNGEN2;

      ------------------------------------------------------------------------------------------

       

      Now I want to build an incremental load writer script (QVD_Writer_Bewegungen2_incr.qvw) that updates my data.

       

      I therefore built a view (also used in the initial load) that contains:

       

      ID - Unique ID for each line of data

      AENDERUNGSDATUM - Edit date of the line of data

      DATA1 - Contains Data i want to analyze

      DATA2 - Contains Data i want to analyze

      ...

       

      My script for the incremental Load:

      ------------------------------------------------------------------------------------------------------------------------------------------

       

      SET ThousandSep='.';

      SET DecimalSep=',';

      SET MoneyThousandSep='.';

      SET MoneyDecimalSep=',';

      SET MoneyFormat='#.##0,00 €;-#.##0,00 €';

      SET TimeFormat='hh:mm:ss';

      SET DateFormat='DD.MM.YYYY';

      SET TimestampFormat='DD.MM.YYYY hh:mm:ss[.fff]';

      SET MonthNames='Jan;Feb;Mrz;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez';

      SET DayNames='Mo;Di;Mi;Do;Fr;Sa;So';

       

      OLEDB CONNECT TO [...]

       

      let Start_Zeitraum = addmonths(YearStart(AddMonths(today(),-1), -2 ),1);    //Start of Data

      Let ThisExecTime = ReloadTime();

       

      V_QLIK_BEWEGUNGEN2:

      SQL SELECT * FROM TEXAS.V_QLIK_BEWEGUNGEN2

      WHERE AENDERUNGSDATUM >= '$(LastExecTime)'

            AENDERUNGSDATUM < '$(ThisExecTime)'

           AENDERUNGSDATUM >= '$(Start_Zeitraum)'

      ;

       

      Concatenate LOAD * FROM [..\QVD\V_QLIK_BEWEGUNGEN2.qvd] (qvd)

      WHERE NOT EXISTS(ID);

       

      Inner Join SQL SELECT ID FROM TEXAS.V_QLIK_BEWEGUNGEN2;

       

      If ScriptErrorCount = 0 then

          STORE V_QLIK_BEWEGUNGEN2 INTO '..\QVD\V_QLIK_BEWEGUNGEN2.qvd' (qvd);

          Let LastExecTime = ThisExecTime;

      End If;

       

      drop table V_QLIK_BEWEGUNGEN2;

      ---------------------------------------------------------------------------------------------------------------------------------------------

       

      But then i get a strange Error right after executing:

       

       

      Can you help me out please?