Alteryx Designer Desktop Discussions

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

Create Folders and Sub folders in it

mohit9garg
8 - Asteroid

Hi,

 

I have very huge data which I want to segregate and save in multiple files. 

 

Same Data

 

CountryCityPersonAgeIncome
IndiaDelhiRam281000
IndiaDelhiSita27900
IndiaDelhiMohan29980
IndiaMumbaiMohit30950
IndiaMumbaiMisha70
AustraliaSydneyMark20200
AustraliaSydneyJohn18150
AustraliaPerthMicheal455000
AustraliaPerthEric382500
AustraliaPerthColette15350
AustraliaMelbourneIsable21600
USNew YorkMark26750
USWashingtonJack29800
USWashingtonMike24500
USSeattleSimon363500
USSeattleJack414700
USChicagoKelvin27550
USChicagoImran331100
USChicagoAndy55650

 

First I want to create folder with "Country" name. Each "Country" folder should have sub-folder with "City" names. Then each sub-folder should have Files with "Person" name. Like below-

 

mohit9garg_3-1614311675806.png

 

Kindly help me in creating a workflow for this.

 

Regards,

Mohit

 

@patrick_digan 

 

20 REPLIES 20
patrick_digan
17 - Castor
17 - Castor

@mohit9garg See if the attached sample points you in the right direction. There are a couple different methods, but I think the render tool is the easiest if it can accomplish what you're after.

 

Wherever this workflow is saved, it will create the folders and subfolders and write each person's info out to their file. Hopefully you can tweak this for your needs.

Emil_Kos
17 - Castor
17 - Castor

Hi @mohit9garg,

I always use the CMD tool in order to create new folders.


Here you can find a link for a workflow that you can test: 

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/How-to-create-folders-and-output-excel...


This workflow now is using the temp folder so it should be changed to for example C:\Test\

Emil_Kos_0-1614344764792.png


After you will change it the workflow will create folders for each of the positions in this column:

 

Emil_Kos_1-1614344822181.png

After you will create those high-level columns you will need to create new folders within them and in order to do so, you will need to use the block until done tool to ensure that first, you will create new folders before you will move forward with the subfolders. 

 

mohit9garg
8 - Asteroid

@patrick_digan can we use it through Output tool. Render tool will take more time than Output tool, given no. of files are ~200.

Emil_Kos
17 - Castor
17 - Castor

Hi @mohit9garg,

 

I have updated the workflow with your data.

 

Emil_Kos_1-1614349964211.png

 


First, it creates Country Folder Afterwards cities folder and at the last stage it puts everything in the relevant folders:

 

Emil_Kos_0-1614349957335.png

Please keep in mind that you need to update temp positions to show the correct folder. For example, it can be replaced with C:\

 

Emil_Kos_2-1614349987979.png

 

I think this solution should suit your needs!

 

mohit9garg
8 - Asteroid

Thanks much @Emil_Kos 

 

Can you please save this workflow in 2020.1 version.

Emil_Kos
17 - Castor
17 - Castor

Hi @mohit9garg,

 

Apologies I needed to amend the workflow in order to make it work. It isn't so easy to change the version for the yxzp file.


So I amended the file in order to make it work. 

 

Now the output file is D:\, not the temporary location.


You would need to change it here in order to suit your needs. 

 

Emil_Kos_0-1614352339145.png

 

mohit9garg
8 - Asteroid

Thanks @Emil_Kos 

 

Please me try. Will reach out to you again if I stuck 🙂

Emil_Kos
17 - Castor
17 - Castor

Hi @mohit9garg,

 

Sounds cool!

mohit9garg
8 - Asteroid

Hi @Emil_Kos 

 

My folder names contain "space"; seems it is causing problem.

 

Is there any fix for that too?

 

Regards,

Mohit

Labels