Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

christian77
Valued Contributor

Script NOT Working

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);

4 Replies
sushil353
Honored Contributor II

Re: Script NOT Working

try to put $(FilePath) with out quotes in for statement

MVP
MVP

Re: Script NOT Working

It is possibly taking long time because it is fetching data from network path. And might be the number of qvds is not very small as well, right?

christian77
Valued Contributor

Re: Script NOT Working

Nope. it does not. Thanks anyway.

Thanks. 68 files.

The point here is that first 1 load does not work inside the loop.

I can't reply individualy.

christian77
Valued Contributor

Re: Script NOT Working

I think is more the asterisk rather than the loop, or they may be both.

first 1 LOAD
    
FechaFoto
FROM

(
qvd);

it's a big difference having 68 records from having 20 million records.

Iill go around. %$#&

Community Browser