Engine Works

Under the hood of Alteryx: tips, tricks and how-tos.
TaraM
Alteryx Alumni (Retired)

In this post I will be focusing on the Directory tool. The Directory tool returns a list of files in a given directory. I have all but given up on the Windows Explorer search in favor of the Directory tool, as I can never seem to find what I am looking for and well, it is so much more fun to do it in Alteryx anyway. Bundle this functionality with a Batch Macro to actually read in the files you are looking for and it can be quite powerful indeed.

 

In a recent post to the LinkedIn Alteryx Group a user mentioned how he really only uses a couple of input files but creates many modules that use these files. He wanted an easy way to search for modules that use this file so that he could leverage some stuff he had already done. If this user is anything like me, he maybe had an idea of doing something with his data and wanted to make sure he didn’t do it already. Happens to me all the time!

 

So I pointed him to a sample to get him started…from the Macro Samples the module, Batch Macro Sample Module, uses a Directory tool to return a list of modules and then a count of all the tools that are used in each module is returned. The supporting Batch macro in this case reads a module file as 0 delimited text and then isolates each tool instance by way of regex matching and returns a count of tools. When run in batch, it does this for each record, each record being a different module file (fed by the Directory tool).

 

What does this have to do with the user’s request? Well, instead of tools, he wanted to know what modules used his files…which means the underlying batch macro would be even simpler. After I responded with this tip to check out the sample, two more users chimed in and said they’d like a wizard that did this. So I made one.

 

The attached Analytic App (that’s what we are calling wizards now) is quite simple. It searches for the specified data file in the directory of the user’s choosing. The user can also narrow their search by looking for specific module types: Modules (yxmd), Apps (yxwz), and Macros (yxmc). It searches all module types by default.

The result is a PDF with some information on what you searched for, when and where. If it finds modules matching your criteria, a list of the files are returned, hyperlinked with their locations so you can simply open your modules from the PDF.

You could certainly leverage more criteria to narrow your search using information returned by the directory tool…search for only modules that were created or changed in the last week or only those files that are within a specific size parameter.

 

This week the spotlight shines on the Directory tool. I want to personally extend my gratitude to this little guy who found a misplaced, 87 layer *.PSD file I had been frantically searching for. Alteryx found it in less than a second while Windows Explorer spun around and around…

 

If there is a tool you’d like me to spotlight, shoot me an email: tmccoy at alteryx.com. I will want to know why you are asking for a particular tool, but I will be happy to write about it.

 

P.S. You can find the File_Finder.yxwz in the samples, accessed from Help-> Sample Workflows-> Analytic Apps-> File Finder

Tara McCoy

Tara McCoy is the Creative Director at Alteryx. Since joining Alteryx in 2004, Tara has held roles in Product Management, Content Engineering, and Community where her focus has always been on delivering an amazing product experience with Alteryx. From designing product icons and community badges, procuring excellent swag, concocting engaging contests, and crowdsourcing content from internal and external Alteryx advocates alike, Tara is dedicated to the Alteryx brand and wants everyone to experience the thrill of problem solving with Alteryx.

Tara McCoy is the Creative Director at Alteryx. Since joining Alteryx in 2004, Tara has held roles in Product Management, Content Engineering, and Community where her focus has always been on delivering an amazing product experience with Alteryx. From designing product icons and community badges, procuring excellent swag, concocting engaging contests, and crowdsourcing content from internal and external Alteryx advocates alike, Tara is dedicated to the Alteryx brand and wants everyone to experience the thrill of problem solving with Alteryx.