ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
RÉSOLU

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

ELPC
Astéroïde

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 RÉPONSES 6
apathetichell
Arcturus

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
Astéroïde

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
Arcturus

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
Astéroïde

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
Astéroïde

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
Météore

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.

Étiquettes
Auteurs des meilleures solutions