Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm bringing in a series of Excel Spreadsheets into a Qlikview document but the spreadsheets don't have a date column. I would like to add a date column but it needs to reflect the name of each workbook. So, I have files called - "Info WC 01-04-16", "Info WC 08-04-16", "Info WC 15-04-16" and so on. It's the WC date I need to create. An added complication is that I concatenate each new file on a weekly basis, so I'm just looking for the newest file in the folder and adding it the bottom of the current data.
Make sense?
Kev
Try this in your load statement
LOAD AllFieldNames,
Date(Date#(Right(BaseFileName(), 8), 'DD-MM-YY')) as Date
FROM SourceFile;
Thanks but it states Bad field name BaseFIleName. Is that because it should be my file name in there?
Thanks,
Filename is now in my date but can i trim it to only include the date part. Currently it states Info WC 15-04-16.xls
BaseFileName() is a function which picks the information from the the file name from which you are loading the data.
Use same function provided by Sunny T.
IT's not liking the Brackets after BaseFileName
Sorry the function is FileBaseName()
LOAD AllFieldNames,
Date(Date#(Right(FileBaseName(), 8), 'DD-MM-YY')) as Date
FROM SourceFile;