community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

Column headers as first row of data

Meteor

Hi,

 

Is it possible to "push" the headings down into the first row of data? so then the first row of data would become 2nd etc.

I know I can do this at the start with the input tool, but later on in my workflow I'm creating several columns which headings I would need in that first row, so ideally I would do this at the very end when my dataset is complete(and all the extra columns are added).

The new headings don't matter to me, it can be whatever as long as I can have my current headings in the first row.

 

Example

HeadingHeading2Heading3Heading4
DataData2Data3Data4
DataDataDataData2DataData3DataData4

 

I would like it to become

new headingnew heading2new heading3new heading4
HeadingHeading2Heading3Heading4
DataData2Data3Data4
DataDataDataData2DataData3DataData4

 

Thanks,

 

Pav

Alteryx Certified Partner
Alteryx Certified Partner

@Pav,

 

I'd try using a field info tool to get the names of the fields.   Then I'd take that data and put a record ID on it.  Then you can crosstab it and have the record ID as the header and the data as the NAME.  You can use a dynamic rename on the output and use a formula to put "FIELD " in front of the field name.  Now you have a row of data to add to your original data.

 

Put this into a UNION (connection #1) and set the union to always use connection #1 first.  Put the original data into the union as #2.  Have the union configured for field position (not auto by name).

 

That's what I would try to solve for your problem.  Please let me know if it works or if you find a more elegant solution.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Magnetar

The Field Info tool will get you the column names in the "Name" column of it's output.  Can you cross tab that to rows, then union on field position?

 

EDIT: Mark beat me to it.  :-)

Meteor

Wow, this works exactly how I wanted it.

Thank you both, I didn't even know about the Field Info tool, really helpful.

 

EDIT: it's just beside Dynamic Rename that I'm using quite often but somehow I didn't notice it :)

 

 

Labels