Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
khaycock
Creator
Creator

Removing characters from field

I want to use the filename of my datafile as a field however the filename is a URL as it's a webfile from SharePoint. Is there a way I can trim a field if the the result is currently like..?

/test.sp.test.com/sites/dept/it/Flat%2020File%20Repository/IT/test/Shapshots/2019-05%20Export.csv

Ideally all I want the field to show is 2019-05 but if its not possible to trim on from the right as well it doesn't matter, it just looks ugly with all the other bits in it!

Labels (1)
1 Solution

Accepted Solutions
Colin-Albert

You can do this using a couple of subfield() commands, to extract the text from the end of the field to the first '/', then from the start of the extracted text to the first %.

subfield(subfield(<yourfilepath>, '/', -1), '%', 1) as file_date

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Strin...

View solution in original post

1 Reply
Colin-Albert

You can do this using a couple of subfield() commands, to extract the text from the end of the field to the first '/', then from the start of the extracted text to the first %.

subfield(subfield(<yourfilepath>, '/', -1), '%', 1) as file_date

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Strin...