Alteryx Designer Desktop Discussions

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

Directory output

Anthony_white
7 - Meteor

I have a workflow that creates about 40 reports that I would like to save to my gallery requiring little to no maintenance. With that said, I would like to configure the output to create a directory for 'year' if one does not exist, and create a subdirectory for the 'month' it one does not exist, and within the month the 40 reports for that month. 

 

Please let me know if this is doable. 

3 REPLIES 3

Hi @Anthony_white 

 

You can use Run Command to create folders

christine_assaad_0-1665006876921.png

Your formula can have your bat script. Something like the below to create a folder for year 2022 and subfolder for Oct, if they don't exist.

You can update the formula according to the logic used in your analysis to decide on year and month.

 

'if not exist "E:' + datetimeformat(datetimetoday(),"%Y")+'/'+datetimeformat(datetimetoday(),"%B")+'" mkdir "E:'+ datetimeformat(datetimetoday(),"%Y")+'/'+datetimeformat(datetimetoday(),"%B")+'"'

 

Results:

christine_assaad_1-1665007062335.png

Attached is the WF to provide guidance on the steps.

Cheers!

Felipe_Ribeir0
16 - Nebula

Hi @Anthony_white 

 

Another option, you can use this python macro that create folders, you just need to adapt to your situation: Create directory if not exists and save the ouput - Alteryx Community

 

If the provided answer helped you to solve the problem/was correct, please accept it as a solution :)

 

Thanks.

Anthony_white
7 - Meteor

When I run this on the gallery, I receive the below unspecified error. Attached is the container from my workflow.

 

Note: the month and year are added to the container from earlier in the workflow. 

 

Anthony_white_0-1666188468215.png

 

Labels