Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to load data from excel where the file name will be 20230127_220124 where 220124 is the time of the night shift. I want to get the name of the file to catch again when loading. What should I do?
You can fetch the file name of the file you are loading by using the FileName() function.
Load *, FileName() as FileName
From .../20230127_220124.xlsx (...);
Try this
Load *,
Dayname(date#(Subfield(FileBaseName(), '_',1), 'YYYYMMDD' )) as file_date,
time(time#(Subfield(FileBaseName(), '_',2),'hhmmss')) as file_time,
FileName() as file_name
From .../20230127_220124.xlsx (...);
You can fetch the file name of the file you are loading by using the FileName() function.
Load *, FileName() as FileName
From .../20230127_220124.xlsx (...);
Hi Vegar
So how do I get the files split into shifts like this?
Try this
Load *,
Dayname(date#(Subfield(FileBaseName(), '_',1), 'YYYYMMDD' )) as file_date,
time(time#(Subfield(FileBaseName(), '_',2),'hhmmss')) as file_time,
FileName() as file_name
From .../20230127_220124.xlsx (...);