Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am doing this: For each vFile in FileList('..\LooseDataFiles\*Capabilities.xlsx') however I dont want it to match the Capabilities.xlsx file only the filenames with stuff before it like 2010Capabilities.xlsx?
Will it always be numbers before it?
no it could be a word or letters or a mixture of both
Can you share some examples of the names of these files?
2013 capabilities
abscapabilities
a b s capabiltiies
12s capabiltiies
q22capabilities
My 2c.
So you want to have data from tables similar to above but not from capabilities.In that case I would do this.
Load Pky,*
From capabilities;
Load *
Where not exists(Pky,PrimaryKey);
Load Pky as PrimaryKey,*
From *capabilities;
This would exclude the data from capabilities table.
Hope it helps.
Thanks
AJ
i just want to grab all the files that have something letters or numbers preceeding the name capabilities.. thats it..I dont want to grab capabilities.xls
Hi Christopher,
I tried a few things but no luck here.
Are there many Excel Files, have you tried renaming them?
Regards
Alan
My code will exactly do that if you have a primary key. If not you can create one using AutonumberHash() function.
I Made some changes.
QUALIFY *;
Table:
LOAD A,
*
FROM capabilities;
UNQUALIFY *;
Main:
LOAD A as Pky,
*
FROM *capabilities;
Store Main into Main.qvd;
Drop table Main;
Main:
Load *
From Main.qvd(qvd)
Where not Exists ([Table.A],Pky);
This will give you data sans capabilities. Try this and let me know.
Hi Chris,
I think I have an answer that may work.
Add FileName() as Filename to the Script
and at the end of the LOAD statement add a WHERE Statement
WHERE LEN(FileName()) >= 18
It means it will only load files that have more than capabilities.xlsx in them