Alteryx Designer Desktop Discussions

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

Input Batch Macro - AKA the Extra Dynamic, Dynamic Input

JoeS
Alteryx Alumni (Retired)

It’s about time I release my “Input Batch” macro, so here we go......

 Meme.jpg

 

 

For those of you familiar with the Dynamic Input, you will know how much of a life saver it can be, but from time to time, you may be frustrated by the need for the file formats to be the same. Both the type of file (Excel, CSV, TXT etc) and also schema (field types, size and number/name of columns).

This can often cause a few issues, as Alteryx reads in the template and will then use that as the type of file, and then the first file it reads in dictates the schema.

 

Well, if you want the ability to read in many different types and many different schemas at once, you are in luck!

 

I have built a macro (with a sub-macro) that will be able to read in: ".yxdb",".cydb",".sz",".avro",".csv",".dbf",".mdb",".xls",".xlsx",".xlsm",".sas7bdat",".sav",".sqlite",".xml”

 

The input required is the full path with extension. This enables you to use the directory tool, apply any logic to filter the list (AKA get todays files) and then input that in.

 

After that it will go through all the files and read them in. Then using the power of Union it will align all columns named the same, any extra columns get added to the end.

 

There is also some extra stuff when it comes to Excel, it will actually loop through all the sheets and read them in one by one.

 

Hopefully some of you will find this useful.

 

If you provide it file types that it is not able to read, it will through a warning.

 

Feel free to add comments about future enhancements and I’ll look to see if I can add them in.

 

Attached is a zip file (.7z), with the installer (.yxi) and some sample data with a sample workflow.

33 RESPOSTAS 33
jknutzen
Átomo

Hi @JoeS, thanks for this great macro! I've been using it in 2022.1 and am in the process of upgrading to 2023.1 when I found your update that some modifications were needed for this tool. I've downloaded the .zip file, changed the extension to .yxi, and run it in Alteryx. I get an error message that it's missing a configuration file.

 

MacroError.png

JoeS
Alteryx Alumni (Retired)

@jknutzen wrote:

Hi @JoeS, thanks for this great macro! I've been using it in 2022.1 and am in the process of upgrading to 2023.1 when I found your update that some modifications were needed for this tool. I've downloaded the .zip file, changed the extension to .yxi, and run it in Alteryx. I get an error message that it's missing a configuration file.

 

MacroError.png


Sorry, if you downloaded the latest upload a couple posts above, that's just the macros and not a full Alteryx installer - as it was intended to just be dropped in the folder after bing installed :)

so if you extra the two files like a normal zip you can then paste them in your install location 

msg11
Átomo

I've been able to use this Macro successfully when using Alteryx Version = 2022.1.1.42636, but when using Alteryx Version = 2023.1.1.336 it stops working.  Is there anything different in newer versions of Alteryx for .xlsx files that would change the way they are read or how sheet names are found within the Macro?  

DavidKennedy
Meteoro

Hi @JoeS,

 

I really like the concept of this macro but I haven't been able to get it to work.  I'm trying to input data from the same sheet ("details") of several different Excel (.xlsx) files.  I all I get is warnings stating that "Sorry .xlsx file type not available..." and I can't figure out why.  Any recommendations?

 

Also, I'm on the 2023.1.  I saw that there was an updated macro for that version but I couldn't seem to get it to install.

 

Thanks,

David

Enquetes
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Rótulos