Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
renjithpl
Specialist
Specialist

Return Folder Name as field

Hi all,

Filebasename() returns file name, Is there a way to get folder name like that.

I tried Filedir() but that gives the whole directory.

THanks in advance.

1 Solution

Accepted Solutions
Not applicable

Hi,

try to use the following script lines:

Load *,
Subfield(Dir,'\', NumberOfTimes + 1) as FolderName;
LOAD
FileDir() as Dir,
substringcount(FileDir(),'\') as NumberOfTimes

Good luck!

Rainer

View solution in original post

2 Replies
Not applicable

Hi,

See the 'Photo and Music' sample from Start Page

subfield(FileLongName,'\',substringcount(FileLongName,'\')) as [Photo Directory]

Regards,

Andris

Not applicable

Hi,

try to use the following script lines:

Load *,
Subfield(Dir,'\', NumberOfTimes + 1) as FolderName;
LOAD
FileDir() as Dir,
substringcount(FileDir(),'\') as NumberOfTimes

Good luck!

Rainer