Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 Paknanarn23
		
			Paknanarn23
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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?
 Vegar
		
			Vegar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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 (...);
 Vegar
		
			Vegar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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 (...);
 Vegar
		
			Vegar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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 (...);
 Paknanarn23
		
			Paknanarn23
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Vegar
So how do I get the files split into shifts like this?
 Vegar
		
			Vegar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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 (...);
