Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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