Alteryx Designer Desktop Discussions

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

Check if the folder name is present or not

Sshasnk
8 - Asteroid

I get multiple file paths from different directory tools now I have to segregate based on the folder name

 

FilePath
C:\program\ABC\lmnop.xlsx
C:\program\mnop.xlsx
C:\program\ABC.xlsx

 

1. Take the file name and keep it in a separate column (name: filename)

2. Check if the last folder is ABC or not (using a filter)

4 REPLIES 4
Emmanuel_G
13 - Pulsar

@Sshasnk 

 

Find in attachement the way of doing that.

 

Let me know if there is any issue and please, do not hesitate to mark this answer as solution if it helped. 🙂

 

Emmanuel_G_0-1664355830179.png

 

AngelosPachis
16 - Nebula

@Sshasnk You can get the FileName from the Directory tool as it already exists as a separate column. 

 

AngelosPachis_0-1664355951390.png

 

You can also check if the last folder is ABC by parsing the Directory column with a regex tool

.*\\(.+)\\

 

AngelosPachis_1-1664356177491.png

 

and filter out the records that are not ABC (in my case it's Sample data.

 

Hope that helps

Sshasnk
8 - Asteroid

@AngelosPachis @AngelosPachis can we do this using filter and formula tool, I have to segregate the data based on if the folder ABC exist or not in filter tool

AngelosPachis
16 - Nebula

@Sshasnk of course, you can use a filter tool with a Regex_Match function under custom filter. That will check if the last folder is called ABC. You can use a similar logic with a contain function if you want to check if any of the parent folders are named ABC 

AngelosPachis_0-1664367763181.png

 

Labels