4 Replies Latest reply: Dec 3, 2014 6:32 AM by Christian Conejero RSS

    Script NOT Working

    Christian Conejero

      Hi: I have this script below. I'm trying to get the QVD with the maximun date. When in a loop, the clause first 1 load DOES NOT WORK, making the script last long. It does work in the second table, out of the loop. I've already try with FileName and FileTime and it is even slower.

      Any suggestion?

      What am I doing wrong? Why it has to read the whole table when it says clearly first 1 load?

      QlikView is a good application but when you put 2 functions together it stops being good. Why?

       

       

      FilePath='\\PATH\QV.Source\99.Shared_Folders\2.QVD\NM_249_QVDS\NM_249_*_*.qvd';
      for each File in filelist ('$(FilePath)')
      /////trace $(File);
      QVDSAVAILABLES:
      first 1 load
      FechaFoto
      from $(File) (qvd);
      next File;
      MAXQVD:
      LOAD
      MaxString(FechaFoto) as FechaFoto2
      resident QVDSAVAILABLES
      group by 1;
      drop table QVDSAVAILABLES;
      let Fecha249 = DATE(peek('FechaFoto2',0,'MAXQVD'),'YYYYMMDD');
      trace $(Fecha249);
      drop table MAXQVD;
      SNP_249:
      first 1 LOAD NumContrato,
          
      //CodEntidad,
           FlagFoto_InicioMes

       

           Field1,

           Fieldn

      FROM
      [$(vG.QVDPath)\NM_249_QVDS\NM_249_$(Fecha249)_*.qvd]
      (
      qvd);