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

Joining multiple files but sometimes all files don't exist

ewassell
8 - Asteroid

I am joining multiple excel files together to produce output.  Sometimes, one of the files doesn't have any information so I don't want to have to have the user create an empty file. I get an error on the input data (can't find the file) and output is not created.  How do I say, if it exists, Join, if not, ignore and continue joining what is available?

5 REPLIES 5
FrederikE
13 - Pulsar

Hey @ewassell,

 

How is the file that the user provides identified?

- Is this an App?

- Or is it accessing a folder with multiple files and always processing all of them.

- Or something else?

ewassell
8 - Asteroid

The user will manually put the files in a directory to be processed.  Right now, I have it so it looks for all the files and then puts them in a union.  Looking for a way to say, if one of the files doesn't exist, continue with the union without it.

ewassell
8 - Asteroid

Sorry - I am putting them in a Union, not joining them at this point.

FrederikE
13 - Pulsar

@ewassell,

 

With a union it is quite easy to do. Just put a wildcard Input in there.

At the Input, instead of the filename, use a star (*). This means that Alteryx pulls in all files from the folder. Like an automated Union in the Input Tool.

 

FrederikE_0-1677506970024.png

 

This requires all Files to be in the same structture. If thats not always the case, you require a batch Macro to do so instead. 

 

ewassell
8 - Asteroid

Thank you so much!  That was easy!!! :)

Labels