Alteryx Designer Desktop Discussions

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

List the directories where the subfolders are variables

HugoY
5 - Atom

Hi,
I've been struggling with a problem in my workflow.
I need a workflow that runs everyday, that lists the directories of specifiec file, but the subfolders names are variables.

I started using the directory tool to list every archive with a specifiec name, but this process is taking too much time, because it has too much subfolders and files.


This is the directory name "C:\Desktop\TEST\"
and the final directory is something like
"C:\Desktop\TEST\" + Datetimeformat(DateTimeToday(),"%Y%m%d") + "\AGROUP\Output_" + RandInt(100) + "\NameFile.csv"

If I could specified the directory date to the Directory tool the run time drops significantly.
"C:\Desktop\TEST\" + Datetimeformat(DateTimeToday(),"%Y%m%d") + "\AGROUP
but I could'nt make it work.

 

Can someone help or suggests another solution to this problem?

Thanks

6 REPLIES 6
binuacs
21 - Polaris

@HugoY Why don't you get all the directories and sub-directories using the directory tool and then filter out the files you wanted using the filter tool instead of making changes in the directory path?

HugoY
5 - Atom

Hi @binuacs,
I tried at first but this process is taking more than one hour.

rzdodson
12 - Quasar

@HugoY are you needing to be able to select a date (e.g. Date tool), and then have it used as a variable to filter down to a specific directory?

 

As an aside, your file directory formula is a bit confusing. Is that intended to be for demonstration purposes to pull a specific file from the desired directory, or are you intending to pull a random file (1-100) from the target directory?

 

Edit: adding a couple of potential solutions for you, @HugoY

DavidSkaife
14 - Magnetar

Hi @HugoY 

 

Here is a way to do it, by turning the Directory Tool into a Macro - I've set it the input up with your required filepath, so all you should need to do is plug it in..

HugoY
5 - Atom

Hi @rzdodson,

I do need to select a date, however it need to be automatically(like a formula), not manually(Interface Date Tool).

 

About the second question is only intended to demonstration purposes, I don´t know the name of the subfolder, so I putted the formula random.

HugoY
5 - Atom

Thank you very much @DavidSkaife !It worked!

Labels
Top Solution Authors