Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, I got 6 xlsx at the begining but actually they are all grouped in one table when i load it, but the problem is if I want to use a filtre it can't filter on all my sheets cause it's not the same column used.So, I want to create a column in my QVD, where the information inside depends on wich xlsx is load.
Like my first file xlsx : 1.xlsx have the same value as my 2.xlsx and I want to define a new column who can separate the value of my 1st xlsx and the value of my 2nd xlsx. The colum name is data and take value like 1,2 for the different files i got to load.
If you have any idea, I'm a little short right now.
Thx guys
Try this
For Each vFile in FileList('C:\Data\*.xlsx')
TempTable:
LOAD *,
AutoNumber(FileName(), 'FileGroup') AS DataSourceID,
FileName() AS SourceFile
FROM [$(vFile)]
(ooxml, embedded labels, table is Sheet1;
STORE TempTable INTO '././CombinedData.qvd' (qvd);
DROP TABLE TempTable;
Next
You can use the function in your script:
FileBaseName() as data
to create value identifying which xlsx these rows were loaded from.
-Rob
You could simply add something like: '1xlsx' as Source if it are separate load-statements and by using a wildcard loop-load it may: filebasename() as Source.