Upgrading Server to version 22.1? We’ve enabled the faster AMP engine by default. Read about how these system settings changes might affect you.

We’re aware of an intermittent issue with our My Alteryx login and are actively working to have the issue corrected. If you run into an error when logging in, please try clearing all cookies or accessing the community on a different browser. Thank you for your patience!

Alteryx Designer Discussions

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

Column headers as first row of data

Pav
7 - 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

3 REPLIES 3
MarqueeCrew
19 - Altair
19 - Altair

@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 restart. Order shall return.
Please Subscribe to my youTube channel.
JohnJPS
15 - Aurora

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.  :-)

Pav
7 - 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