Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
shane_spencer
Specialist
Specialist

String Function similar to subfield

I've got the following values in a field call "Document"

\\hbeu.adroot.hsbc\dfsroot\gb002\corep_mi_qlikview\qlikview files\fermat\fermatqlikviewapp\april13 month end report r7a.qvw

\\hbeu.adroot.hsbc\dfsroot\gb002\corep_mi_qlikview\qlikview files\fermat\fermatqlikviewapp\december12 month end report r5.qvw

\\hbeu.adroot.hsbc\dfsroot\gb002\corep_mi_qlikview\qlikview files\fermat\fermatqlikviewapp\june13 month end report r7a.qvw

\\hbeu.adroot.hsbc\dfsroot\gb002\corep_mi_qlikview\qlikview files\fermat\fermatqlikviewapp\june13 reconciliation report r7a.qvw

\\hbeu.adroot.hsbc\dfsroot\gb002\corep_mi_qlikview\qlikview files\fermat\fermatqlikviewapp\reloading monitor.qvw

\\hbeu.adroot.hsbc\dfsroot\gb002\corep_mi_qlikview\qlikview files\fermat\fermatqlikviewapp\variance report r7a.qvw

\\hbeu.adroot.hsbc\dfsroot\gb002\corep_mi_qlikview\qlikview files\monitors\qv10systemmonitor.qvw

\\hbeu.adroot.hsbc\dfsroot\gb002\corep_mi_qlikview\qlikview files\qv10systemmonitor.qvw

I've used the following as a dimension in a chart to get just the filename and not the full path:

=subfield(Document,'\',10)

This works for all the Documents with the following path:

\\hbeu.adroot.hsbc\dfsroot\gb002\corep_mi_qlikview\qlikview files\fermat\fermatqlikviewapp\

....but not the others. Is there a similar function I can use to extract the file name from right to left (instead of left to right) picking anything to the right of the "\" on the far right?

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

=subfield(Document,'\',-1)

The negative value counts from the right.

-Rob

View solution in original post

2 Replies
mphekin12
Specialist
Specialist

how about something like:

=subfield(Document, '\', substringcount(Document, '\') + 1)

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

=subfield(Document,'\',-1)

The negative value counts from the right.

-Rob