Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.

How to split rows in excel to different excel as output

Sanjana_HS
8 - Asteroid

Hi,

 

I want to get excel sheet for each rows and each row should contain same header.

 

Like in the below image 

i want alexandar charles with headers in different excel output and andreas with header in different excel output

Screenshot_20230214_200037_Gmail.jpg

header

3 REPLIES 3
DataNath
17 - Castor
17 - Castor

Hey @Sanjana_HS, here's one way you could go about this...

 

Step 1 is to add a RecordID to your data in order to give each row a unique identifier:

 

DataNath_0-1676392046023.png

 

Step 2 is to build the filepath for your Excel outputs - the RecordID is integrated into this to dynamically create a different path for each row which will therefore output them as different files:

 

DataNath_1-1676392140311.png

 

Step 3 is preferential - I've just removed the RecordID but you may want to keep it?

 

DataNath_2-1676392164053.png

 

Final step is to add an Output Data tool, configure it as normal for an Excel output, and then set the bottom part of the configuration up like so:

 

DataNath_3-1676392202272.png

 

Key aspects being Take File/Table Name From Field > Change Entire File Path > Field Containing File Name or Part of File Name = field you made > Choose whether or not to Keep Field in Output

 

When you run the workflow, the outputs will be one for each record:

 

DataNath_4-1676392375323.png

 

Hope this helps! A couple of things to note...

 

I had to add the RecordID as (unless it's just elsewhere that isn't shown in your screenshot) there are no unique identifiers in your data. I.e. if you were to try and group on name(s), you'd get outputs containing multiple records if 2 or more people had the same first/last/both names. Also, in the Formula tool you'll just need to replace my filepath with your own, replacing the 'Output' part with whatever you want the filename to be. Also, I have just used the standard 'Sheet1' naming, but you can change this to whatever you want as well.

Sanjana_HS
8 - Asteroid

Sanjana_HS_0-1676433967757.png

I am getting this error

jakemiroquai
7 - Meteor

Hi there,

 

Your solution has helped me splitting the excel file into individual files! However, i was wondering if it would be possible to modify the row data that's going to be outputted into something like 'Male' under a Gender field into 1 to represent the male gender in the Gender field? Additionally, would it also be possible to output the row data into a different format/adding more fields etc? Any help would be appreciated! Cheers

Labels
Top Solution Authors