Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
bobbydave
Creator III
Creator III

Filebasename()

So I have files that I take in the following

  • Date
  • Area
  • Service

The file name is Date_Area_Service.xlsx

E.g.

042016_Breach_AST

042016_Breach_ADS

042016_Breach_Mgmt_Info

042016_Breach_IT_Ops

I can get the Date and Area and to get the Service part of the filename, I use FileBaseName()

                                              SubField(FileBaseName(), '_', -1)

which is all well and good if it is AST or ADS but when I have to get Mgmt_Info, I will only get Info and IT_Ops will only give me Ops.

Anyone know how I would get

ADS

AST

Mgmt_Info

IT_Ops

Thanks

1 Solution

Accepted Solutions
sunny_talwar

May be this:

Mid(FileBaseName(), Index(FileBaseName(), '_', 2) + 1) as FieldName

View solution in original post

3 Replies
sunny_talwar

May be this:

Mid(FileBaseName(), Index(FileBaseName(), '_', 2) + 1) as FieldName

bobbydave
Creator III
Creator III
Author

Saving the world as usual, Sunny!

sunny_talwar

Hahahaha, I am glad I was able to help