Discussion Board for collaboration on QlikView Scripting.
I have a list of filenames as a column in a qvd file. How can use them for importing data in a loop such as
FOR Each File in FileList ()
Go to Solution.
Concat(Chr(39)&filenames&Chr(39), ', ') as filenames
LET vFileNames = Peek('filenames', 0, 'FileNamesTable');
DROP TABLE FileNamesTable;
FOR Each vFile IN $(vFileNames)
Could you please explain what Peek function does here.
Currently in variables overview vFileNames is empty
here (second example) a possible answer
you should get a table named 'FileNamesTable' with only 1 row containing values field 'filenames' concatenated like 'Field1', 'Field2', 'Field...'
peek function gets the value of this row and put it into vFileNames variable.
Because, you have 2 identical tables, QlikView auto-concatenate them and that's the reason your peek function doesn't work.
Here, I attached an example.
u will excatly get what u want only specify the ur path location in the path location path
For each file in Filelist( 'pathLocation\*.qvd')
'$(file)' as FileName,
Floor( FileSize('$(file)')/1024) as FileSize,
SubField( '$(file)','\',-1) as FileType
Yes, but sometimes you want to load a list of SQL table names to extract data in a loop. For dimension tables for instance.