Discussion Board for collaboration on QlikView Scripting.
From my payroll system, every two weeks a text file is created, which I need to load into qlikview
The text files are all stored in the same hard drive folder (C:\textfiles\) and are named
The format of the files are completely the same, and they all need to be concatenated into the same Qlikview table.
How do I create a load statement that dynamically loads ALL text files, no matter if there are 3 or 300 in the folder?I also need a datafield in the qlikview table that contains the source file name.
Please help. 
Go to Solution.
mid(filename( ), 13, 5) AS WeekNumberData
FROM Payroll_week*.txt (....)
somthing like this should do the trick:
For each txtFile in filelist ('*.txt')
Field2, '$(txtFile)' as Name, FileName('$(txtFile)') as FileName, FileSize('$(txtFile)') as Size, FileTime( '$(txtFile)') as FileTime From '$(txtFile)' ; NEXT txtFile;
Thx guys, i'll give it a go!
i have a problem with the FROM syntax.
I can doFROM Payroll_*.txt if my filename is Payroll_xyz.txt
it wont work if the filename is Payroll_xyz_2011-08-05.txt.
is this normal? or something is wrong?