Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Creating column headers

boston99
7 - Meteor

I've just started with Alteryx today and I have CSV files that don't have a header. The files are too big to open in Excel and create a header, so I was wondering if there was any way to do this in Alteryx? I have files for each quarter that I'd like to be able to give the same header to run some analysis on, but can't link them properly without them having a similar column header for each column. 

2 REPLIES 2
Bob_Blackey
11 - Bolide

Hi,

 

Welcome to the wild and wacky world of Alteryx! Kudos for finding the community so quickly, it's a great resource.

 

The thing to remember is "There's always a way to do in Alteryx!"   (99.43% of the time ;-)  

 

There's two ways to do this:

 

1) if the file doesn't have too many columns (but has lots of rows I'd guess from the Excel issue) then you could just use an Input Data tool to read in the file and then follow it by a Select tool and you can manually rename each column in the select tool in the Rename column. 

 

But as I reread your question I see you have multiple files so this second choice sounds better:

 

2) In EXCEL I would create a spreadsheet which just has one row with the Column headings in the first row.  (or it could be a CSV file with comma separated names)

 

In Alteryx I'd have two input data tools, one for the Excel file and one for the CSV file. Make sure both are set in the properties not to take the field names from the first row.

 

You'd then UNION tool the two data streams and use the AutoConfifg by position option. Also  use the option at the bottom of the Union tool to make sure the column heading file is first.

 

Then you would use the Dynamic Rename tool (in the developer toolset [or use the search box]) and choose the option to take the field names from the first row.  (Note that most tools which have two inputs require both inputs but in this use case the Dynamic Rename tool doesn't need the second input.

 

Then you'd save the file with the Output Data tool. 

 

Here's a picture:

 

RenameCSV.png

 

I've attached an example which uses Text Input tools for sample data.

 

Cheers,
Bob

 

 

 

kush124
5 - Atom

Thank you Bob_Blackey. I used option 2 for a similar problem I had and it worked perfectly!.

Labels