Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

What's the formula to parse the Sheet Name from Fullpath column

ELPC
8 - Asteroid

I saw some posts that say you can use the formula tool to parse the Sheet name from the Fullpath column coming out of the input tool but I haven't been able to find the formula.  Can someone please tell me what formula to use?  Thanks.  

 

6 REPLIES 6
apathetichell
18 - Pollux

your input tool has an option to bring in the filename. That option has a choice between filename and fullpath. It will become it's own separate field in your workflow and you can parse it as you wish.

ELPC
8 - Asteroid

Right.  I brought in the fullpath and I need to parse the sheet name out of the fullpath.  That is the part that I do not know.  I read in another post that someone suggested the TRIMLEFT formula but I have no idea how to use that formula to trim off just the last part of the fullpath to obtain the Excel sheet name.  

apathetichell
18 - Pollux

Try this in formula tool set for a new filed:

regex_replace([FileName],".*\\(.*\.xlsx).*$","$1")

 

This assumes you only want the filename - not filename and sheet name...

ELPC
8 - Asteroid

Sorry, I only want sheet name and do not need filename.  I don't understand RegEx syntax very well so how do I get just the sheet name?  Thanks. 

ELPC
8 - Asteroid

Ok, I finally found this post that detailed the below formula that helped me parse the "sheet name" out of a the excel full path.  

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Full-path-file-name-regex-help/td-p/38...

 

 

RIGHT([FULLPATH],FINDSTRING(REVERSESTRING([FULLPATH]),'|'))

 

alexcordero
7 - Meteor

I used .+\|{3}(.+[A-Z]) in the RegEx tool to split full path into sheet name.  So that file with C:test\abc.xlsx|||xyz$ returns just xyz.  I'm sure there is a better regex, but this worked.

Labels