Alteryx Designer Desktop Discussions

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

Macro to Output Different Text Files

pacopenamedina
7 - Meteor
 

I am new to Macros and don't entirely know how they work, I want to know how I would get started with trying to output different text files (Have different fields, but will be the same .csv \t delimited) Is something like this possible? Ideally I want to only have to update a single directory where the files get spit out to.

2 REPLIES 2
Prometheus
12 - Quasar

@pacopenamedina You don't really need a macro for this. If you have different sets of fields going to different text files, you can just add an Output Data tool for every set of fields you want and you can output them all to the same folder.

rzdodson
12 - Quasar

@pacopenamedina I would recommend starting with this article, as it will be a helpful primer to macros: https://help.alteryx.com/current/en/designer/apps-and-macros/macros.html#idm46230556179680

As an aside, please refrain from cross-threading from a "Solved" thread: https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Exporting-Multiple-Text-Files/...


As @Prometheus explained, you do not need a macro for this. You simply need to create a dynamic output path which tells Alteryx which set of data goes to which file (once saved). In your use case. since we are working with CSVs, I would recommend something like this:
Solution 1.png

This will output the CSVs to the same directory your workflow is saved. If you need this to be a sub-directory within that parent folder, you would need another string prior to your file name followed by a "\". Using the above example, it would look like this:


[Engine.WorkflowDirectory] +

"Your subdirectory\"

[Username] + "-" +

DateTimeFormat(DateTimeNow(),"%d %b %Y") + 

".csv"
Labels