Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to Create Folder For New MonTH

prpanw
8 - Asteroid

Hi Folks,

Can anyone asist how to create folder for new month and then save output in that folder everymonth.

2 REPLIES 2
Yoshiro_Fujimori
15 - Aurora
15 - Aurora

Hi @prpanw ,

 

Creating a folder is a function of OS (Windows).

To achieve this, you need to run a batch script from Run Command tool.

For the usage of this tool, you may check the sample workflow.

You may also want to check Tool Mastery | Run Command page.

 

Here is a sample workflow.

It will create a folder for each month (YYYYMM) in the input data under the workflow directory.

 

Workflow

The workflow replaces the placeholders in the batch template (workflow directory and folder list) .

You may want to change the flow to prepare the folder list as necessary.

workflow.png

Batch Template

@echo off
cd @workflowDirectory@
set "folderList=@folders@"
for %%i in (%folderList%) do (
  if not exist "%%i" (
    mkdir "%%i"
    echo added folder "%%i".
  ) else (
    echo folder "%%i" already exists.
  )
)

 

 

Yoshiro_Fujimori
15 - Aurora
15 - Aurora

For the "then save output in that folder every month" part;

once the folder is created, you just need to output to each folder

with "Take File/Table Name from Field" option of Output Data Tool as below.

workflow.png

Labels
Top Solution Authors