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: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

User part of filename as field

Hi all,

I loop through a load of files in the script and need the beginning of the filename to be a new field so i know which file it has come from.

i.e.

the files i read in are :

BOB125_date

CWSL_date

PLDE22_Date

so what i want is to use everything before the _ as a new field.

Can anyone help?

1 Solution

Accepted Solutions
marcus_sommer

You could use something like this: subfield(filebasename(), '_', 1) as Source.

- Marcus

View solution in original post

1 Reply
marcus_sommer

You could use something like this: subfield(filebasename(), '_', 1) as Source.

- Marcus