Pivot - Convert Rows to Columns
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have a data set that needs to be pivoted to work with it. Each person has a separate column in the table and all of the data for the person is in the column. I need to transform the table so that each person is in a row and the data for the person is in multiple columns in a single row.
If I were doing this in SQL in a database, I know exactly how I would do it either manually or using a Pivot clause. But, I can't figure out how to do it in Alteryx. The Transpose tool is giving me multiple records per person, each with a different piece of data. I've also tried playing with the Cross Tab and Arrange tools, with no success. I'm obviously overlooking something. Does anyone have any thoughts?
Solved! Go to Solution.
- Labels:
- Datasets
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @DellChristy
I've attached a sample workflow, so hopefully that's along the lines with what you are looking for. If not, can you post an example of your dataset.
There is also a Totally Transpose macro that might help too.... https://community.alteryx.com/t5/Engine-Works/Totally-Transpose-like-totally/ba-p/30222
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @DellChristy
You just need to do a transpose and then a summarize. See attached for a quick example below:
Dataset before:
After:
Thanks,
Pedro.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@pedrodrfaria, That would be great if I were trying to summarize the data, but I'm not. With each row containing a specific piece of data, like name, department, or score, I need to have a table with, for example, name, department, and score columns and a row for each person currently defined by a column.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @DellChristy
Is it this you are looking for?
You can do use the output data to output each person to the specific table if you are also trying to output them separately.
Pedro.
