Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Splitting data into multiples files/outputs based on column value

SamThomas
6 - Meteoroid

Hi

 

I have a large amount of data that I need to split into different files/outputs. One column contains 1 of 7 values, so I want to split the data into these 7 categories. 

 

What would be the best way to do this?

 

Ideally these outputs will be into QVX files so I can go ahead and visualise in Qlik. 

 

Thanks in advance. 

 

 

6 REPLIES 6
ShankerV
17 - Castor

Hi @SamThomas 

 

Hope you are expecting the output like this where all 7 categories are in different sheets.

 

ShankerV_0-1676976506040.png

 

The below setting in the Output tool, helps to achieve.

 

ShankerV_0-1676976618099.png

 

DataNath
17 - Castor
17 - Castor

Hey @SamThomas, as you've mentioned you want your outputs to be .QVX files, just choose that and set a FileName, then you can use one of these options to differentiate your 7 files, selecting the Field containing your 7 values as the 'Take File/Table Name From Field':

 

DataNath_0-1676976768783.png

 

Here's an example of outputting to a bunch of files with the field suffixed to the core FileName:

 

DataNath_1-1676976804603.pngDataNath_2-1676976810845.png

SamThomas
6 - Meteoroid

Thanks for your response. This worked as expected. The only very slight issue is that when it creates the filenames, it doesn't leave a space between the name and value. So it structures it like this WORKFLOWNVALUE.qvx. Do you happen to know how I might be able to add a separator? 

DataNath
17 - Castor
17 - Castor

Hey @SamThomas, great to hear! For this, I'd actually just make my filenames in a formula like so:

 

DataNath_0-1676978711403.png

 

Where 'Test' is whatever you want the 'core' filename to be, and then referencing the field with your 7 values where I currently have [Name]. Once you come to the Output Data tool, you then reference this custom field and choose 'Change File/Table Name' from the dropdown. This will then completely replace whatever you set up in the configuration originally, hence why I have just used 'dummy.qvx':

 

DataNath_1-1676978796753.png

 

When you run that:

 

DataNath_2-1676978806623.png

 

Workflow attached for your reference, hope this helps!

SamThomas
6 - Meteoroid

Great, thanks again. Much appreciated. 

Jodie_sam
5 - Atom

Hi There,

 

I wanted to split my data into multiple tabs into one output by a column value names, your solution works perfect. The only challenge I am facing is the sheet names Alteryx creating has a prefix to it, for e.g sheet1A and I would need only A,B,C (as in individual tabs) instead Sheet1A,Sheet1b, Sheet1C. Could you please help with this?

 

Many thanks.

Labels