Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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?

Tags (2)
1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: String Function similar to subfield

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

The negative value counts from the right.

-Rob

View solution in original post

2 Replies
Highlighted
Specialist
Specialist

Re: String Function similar to subfield

how about something like:

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

Highlighted
MVP & Luminary
MVP & Luminary

Re: String Function similar to subfield

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

The negative value counts from the right.

-Rob

View solution in original post