Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Easiest way to grab all files in a directory, add the creation date and union

Carluccio555
9 - Comet

Having trouble getting dynamic input and directory tool to work together.

 

What I need to do: grab all files in a directory, add the creation data as a field (excluding time) and then union everything

 

thanks

8 REPLIES 8
cjaneczko
13 - Pulsar

Are all of the files in the same format? Take a look at this post. I use this batch macro in conjunction with the directory tool to pull ALL files in a folder. The Directory tool will generate a field with the Creation date.

 

https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Input-Batch-Macro-AKA-the-Extr...

Carluccio555
9 - Comet

Files will all be xlsx, can this be done without a batch macro?

binuacs
21 - Polaris

@Carluccio555 If  your files are in different schema then the only option is the batch macro

Carluccio555
9 - Comet

OK Ive got the batch macro working to union the files, heres the macro, how do I add the creation time, directory tool is on deck

 

image.png

Carluccio555
9 - Comet

image.png

Directory tool>Select>formula.  So I guess I have to join this using the file name in the control paramter?

cjaneczko
13 - Pulsar

Yes, you would join the Directory tool to your Batch Macro output and link it via the File name or Full Path, whichever field comes out of the macro. Then only bring over the Creation Date from the Directory tool.

cjaneczko
13 - Pulsar

On a side note to plan ahead, in the event one of the files is open while the batch macro is running, you can insert the below to skip that opened file. It will save you a headache. Anchors highlighted in Red are from the same input (directory tool) with the Join on FileName. 

 

 

image.png

Labels