Discussion Board for collaboration on QlikView Scripting.
I have an issue loading data from excel.
The excel document will be generated monthly , and the file name of the document will be named after the month.
I know I can deal with each file by loading * but how would I deal with the sheet names because that will change on each document as well?
Your assistance is appreciated.
FROM $(vPath)\Sales_*.xlsx (ooxml, embedded labels, table is Sales_20160131);
Go to Solution.
My First Post in Resources : Load Multiple Excel Files With Different Sheet names
See if this helps: Loading Multiple Excel Sheets Dynamically along with file name and sheet name
Dynamically Loading Multiple Excel Files
Load like this:
For Each vFile in FileList('<path>\Sales*.xlsx')
Let vFilename = SubField(SubField(vFile, '\', -1), '.', 1);
Let vSheet = 'Sales_' & TextBetween(vFilename, 'Sales', '.xlsx')
BaseFileName() as FileSource,
Date(Date#(TextBetween(BaseFileName(), 'Sales', '.xlsx'), 'yyyyMMdd')) as FileDate
(ooxml, embedded labels, table is $(vSheet));
(Replace <path> in the FileList statement with the correct path to the source files)
Check this link:
Load all Excel files and all sheets in a folder
Hope it helps!!
Thank you this is very simple , and seems to be effective.
is the correct syntax "FileBaseName() "
For some reason when I do it this way it reloads but doesn't return anything in the table.