Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
How to load these files dynamically?
EAST_SAL_2016.xls |
EAST_COMM_2016.xls |
WEST_SAL_2016.xls |
WEST_COMM_2016.xls |
NORTH_SAL_2016.xls |
NORTH_COMM_2016.xls |
SOUTH_SAL_2016.xls |
SOUTH_COMM_2016.xls |
Thanks in advance.
What do you mean by dynamically?
If the file name changes, you can use wildcards to load them.
I have used this script.
But I am looking for better way.
LOAD *,
FileName() as FileName
FROM
*.xlsx
(ooxml, embedded labels, table is [$(*)]);
The way you are loading is perfect and I don't think there is any better way. If you think I am missing the point can you explain with little more details...
I am not sure your question as I understand, you can load using qvd. Before that I've to ask one thing. In these files all field are same
Are these file having same structure, are they auto concatenating sometimes and sometime not when new fields added? Do you need only one time load or require incremental load?
SAL is one structure, COMM is different structured data.
If the files have different structure the answer to your questions depends on the difference in structure. Perhaps the data is suitable to force into same table, or perhaps it fit better in two (or more) tables. You will have to provide samples of the structure and your expectations to enable any detailed suggestion.
A better way could be to load with a filelist-scan like: Dynamically Loading Multiple Excel Files.
- Marcus
In this case I would use two loads in your loop in an if with a wildmatch to check the filename
So if it sees SAL it does load 1 to load fields x,y,z
if it sees COMM it does load 2 to load fields 1,2,3
Please remember to mark this as helpful or the correct answer if I have helped you or answered your question.