2 Replies Latest reply: Jun 17, 2015 9:24 AM by Jonathan Dienst RSS

    Peek max date for incremental load

    Finn De Wit

      Hi,

      im trying to start an incremental load based in timestamps.

      BUT the creation of a variable with which i want to limit the load does not work.

      let vMAXTIMEms= 'peek(time_mill,-1,data_table) ;

      seems to be completely ignored by the qlikview script (no syntax error on that line).
      at the line where the variable should be used, i get an error. what is wrong ? Maybe some problems with peek and the variable ?

       

      Any ideas ?

       

      The table looks like this

       

      data_table:
      LOAD 
          source_ID,
          source_TYPE,
          time_RES,
          time,
          time_mill,
          UNIT,
          VALUE
      FROM ./QV_VALUES.qvd
      WHERE time_RES = 'DAY'
      AND   source_TYPE = 'A'
      ;    
      

       

      The plan is to follow these steps in the script
      1. load the old data from qvd to get the date of the last entry. To speed this up, only the timestamp field is loaded

      data_table:
      LOAD 
          time_mill
      FROM ./QV_VALUES.qvd
      WHERE time_RES = 'DAY'
      AND   source_TYPE = 'A'
      ;    
      

       

      2. write the max(timestamp) in a Variable vMAX_mill

      let vMAXTIMEms= 'peek(time_mill,-1,data_table) ;

       

      3. use $(vMAXTIMEms)>=time_mill
      in the incremental part of the loadscript