Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

How to create a dynamic output folder?

mocalvo
7 - Meteor
I have a workflow that needs to save the reports to a new folder with a date stamp each month. I figured how to date stamp the actual files but don't know how to create the dynamic folder with the date stamp. Hopefully I've attached my sample workflow correctly. I just need help creating the folder \Dynamic 20170719\. I hope I've explained myself correctly. Thank you! Monica
8 REPLIES 8
patrick_digan
17 - Castor
17 - Castor

@mocalvo I would use the MKdir command and create a temp bat file to do that. I've attached a working version on my end. You can tweak the formula tool to get the folder naming convention just right. I wasn't sure if you wanted a monthly or daily folder, and whether you wanted the dashes in the folder name. You can use the DateTimeFormat function if you wanted to get rid of the dashes in the folder or file name.

 

EDIT: the first file had a small issue with the data coming into the append tool. It has been corrected.

mocalvo
7 - Meteor
Thank you so much for such a quick response! The workflow worked great on my end to create the folder. I just need to figure out why all of my data didn't work it's way to the final file. Only one row was populated. Thanks!
patrick_digan
17 - Castor
17 - Castor
That was my fault :) I put an updated file out there but I wasn't fast enough. I accidentally connected the sample tool to the append fields tool.
mocalvo
7 - Meteor
You are awesome...thank you for your help! My browser at work isn't letting me click on the "Accept As Solution" button. I'll click on it when I sign in from home. I've already shared your solution with my co-workers. We are very grateful!
tazeen
5 - Atom

Hey, I am getting the error "Error: Run Command (50): The external program "%temp%bat.bat" returned an error code: 1"

How can I fix this?

sneha_bhiwagade1
8 - Asteroid
You can check the .bat file.
In that file check the folder path contains spaces or not. If it contains spaces then eliminate spaces from the mentioned folder path.
Your folder path should be without spaces.
Eg: C:/Users/FolderName
EtamSoko
8 - Asteroid

@patrick_digan 

 

Hi Patrick,

 

I found this older thread regarding dynamic output folder and I was wondering if you could help me with a case that might be related to this one.

 

I have a dataset with including 200 vendors and their related activities. Each vendor has a unique vendor code im my dataset.  I would like to separate the dataset for as many excel files as many vendors I have in the dataset and include their respective information. 

 

Is it possible to achieve in similar way to the case below? 

 

thanks very much for the help in advance!

Regards,

MateK

patrick_digan
17 - Castor
17 - Castor

Hi @EtamSoko if you're looking to use the output tool to save to different excel files, you can use the "take file/table name from field" option at the bottom of the output tool. If you're very particular about the naming convention, you could use a formula tool before the output field to create a field that holds the entire file name (for example "C:\My folder\" + [MyVendorName]+".xlsx|||Sheet1") and then use the change entire file path option at the bottom of the output tool. If you build your process and reach a road block, feel free to start a new thread and ask for help!

Labels