Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
In my qlikview document I load a couple of document locations. The problem is that i only want to load the document name and not the entire path. The problem is that the path to the documents isn't always the same length. For example:
What I load | What I need |
---|---|
C:\Documents\document1.qvw | document1.qvw |
C:\Documents\Customer1\Document3.qvw | Document3.qvw |
C:\Documents\Customer 3\Document 2.qvw | Document 2.qvw |
Does anybody know a solution for this problem?
Thanks a lot for your help!
or subfield([Source field], '\', -1) as [Destination field]
subfield([Source field], '\', substringcount([Source field], '\') + 1) as [Destination field]
or subfield([Source field], '\', -1) as [Destination field]
Hello,
Could you use right(DocumentName(),13)??
Regards.
Subfield(YourPath, '\', -1)
Or,
You might check if file functions like:
Filename() could help you.
or
SubField[FieldName], '\', -1)
Subfield splits a string base don a specified separator, the parameters:
1st: the string
2nd: the separator
3rd: wich splited part you want to retrieve, negative numbers counts starting by the last
Hi mate,
I've done what you need by using this expression:
=SubField(LOAD, '\', substringcount(LOAD, '\')+1)
Here take a look at my qvw
Regards,
MB
Thank you very much! This was exactly what I need!
You can use the subfield() function like this:
SubField('C:\Documents\Customer 3\Document 2.qvw','\',-1)
The second parameter allows you to break the string down, in your case by the backslash and passing the -1 parameter at the end of the function will ensure you only ever pick up the final part of the string.
Hi,
maybe also helpful:
tabFileNames:
First 1
LOAD FileName() as FileName, [@1:1] as Temp
FROM QlikCommunity_Thread_189*.qvw (fix, codepage is 1252);
DROP Field Temp;
regards
Marco