Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
clau2003cos
Contributor III
Contributor III

Carregar alguns qvds

Boa tarde!

Tenho uns 50 qvds gerados com data e nome Ex:

20151127_NOMETABELA.QVD

20151126_NOMETABELA.QVD

20151125_NOMETABELA.QVD

.........

estou querendo caregar somente 10 desses 50 qvds.

E possivel fazer a leitura somente desses 10 fazendo um FOR?

Grato!

Labels (3)
1 Solution

Accepted Solutions
maxgro
MVP
MVP

Small example with txt files, 4 files, I load 2 of them

Change (adapt) txt to qvd



// read all file names

FOR Each file in FileList('????????_NOMETABELA.TXT')

  trace $(file);

  FILES:

  load '$(file)' as file AutoGenerate 1;

NEXT; 

// new table with onle some (in my case 2) files, the first 2 order by file name desc

FILESTOREAD:

NoConcatenate

First 2 load file

Resident FILES

Order by file desc;

DROP Table FILES;

// read the 2 files

FOR i=0 to NoOfRows('FILESTOREAD') -1

  LET filetoread=Peek('file', $(i), 'FILESTOREAD');

  trace file to read $(filetoread);

  LOAD @1

  FROM

  [$(filetoread)]

  (txt, codepage is 1252, no labels, delimiter is '\t', msq);

NEXT;

View solution in original post

1 Reply
maxgro
MVP
MVP

Small example with txt files, 4 files, I load 2 of them

Change (adapt) txt to qvd



// read all file names

FOR Each file in FileList('????????_NOMETABELA.TXT')

  trace $(file);

  FILES:

  load '$(file)' as file AutoGenerate 1;

NEXT; 

// new table with onle some (in my case 2) files, the first 2 order by file name desc

FILESTOREAD:

NoConcatenate

First 2 load file

Resident FILES

Order by file desc;

DROP Table FILES;

// read the 2 files

FOR i=0 to NoOfRows('FILESTOREAD') -1

  LET filetoread=Peek('file', $(i), 'FILESTOREAD');

  trace file to read $(filetoread);

  LOAD @1

  FROM

  [$(filetoread)]

  (txt, codepage is 1252, no labels, delimiter is '\t', msq);

NEXT;