Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Paknanarn23
Creator II
Creator II

I want to load data from excel

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?

Paknanarn23_1-1674873639696.png

 

2 Solutions

Accepted Solutions
Vegar
MVP
MVP

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 (...);

View solution in original post

Vegar
MVP
MVP

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 (...);

View solution in original post

3 Replies
Vegar
MVP
MVP

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
Creator II
Creator II
Author

Hi Vegar 

So how do I get the files split into shifts like this?

Paknanarn23_0-1675046487561.png

 

Vegar
MVP
MVP

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 (...);