Transposing or Splitting a Table in Arc

1220
2
Jump to solution
05-12-2014 01:52 PM
MelissaSlater
New Contributor III
I have an output table with 2 columns and 2 rows and I need to consolidate the information into just 1 row. I've tried creating a pivot table but it does not quite work (still retains 2 rows). I've attached a couple screen grabs that illustrate the current table and the table that I need. Unfortunately I cannot do this manually as this needs to be done for several hundred tables and I need to find a tool I can iterate through in Model Builder. Ultimately I need to apply each of these values in a Raster Calculator.
Any suggestions?
Thanks!
Melissa
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: rfairhur24

I have an output table with 2 columns and 2 rows and I need to consolidate the information into just 1 row. I've tried creating a pivot table but it does not quite work (still retains 2 rows). I've attached a couple screen grabs that illustrate the current table and the table that I need. Unfortunately I cannot do this manually as this needs to be done for several hundred tables and I need to find a tool I can iterate through in Model Builder. Ultimately I need to apply each of these values in a Raster Calculator.
Any suggestions?
Thanks!
Melissa


You would need another column for a unique ID number that would consolidate the data using the Pivot Table tool.  For example, you could use the Add Field tool to add a field called MY_ID and the Field Calculator tool to calculate all of the values of that field to 1 or some text value that could later act as a join value.  Then use that repeated value as the unique case field, the text field as the Field Names field and the numeric field as the Values field.  That should pivot the values to a single row beginning with the MY_ID value, then the two named fields each with the numbers associated to them that you want.

View solution in original post

0 Kudos
2 Replies
by Anonymous User
Not applicable
Original User: rfairhur24

I have an output table with 2 columns and 2 rows and I need to consolidate the information into just 1 row. I've tried creating a pivot table but it does not quite work (still retains 2 rows). I've attached a couple screen grabs that illustrate the current table and the table that I need. Unfortunately I cannot do this manually as this needs to be done for several hundred tables and I need to find a tool I can iterate through in Model Builder. Ultimately I need to apply each of these values in a Raster Calculator.
Any suggestions?
Thanks!
Melissa


You would need another column for a unique ID number that would consolidate the data using the Pivot Table tool.  For example, you could use the Add Field tool to add a field called MY_ID and the Field Calculator tool to calculate all of the values of that field to 1 or some text value that could later act as a join value.  Then use that repeated value as the unique case field, the text field as the Field Names field and the numeric field as the Values field.  That should pivot the values to a single row beginning with the MY_ID value, then the two named fields each with the numbers associated to them that you want.
0 Kudos
by Anonymous User
Not applicable
Original User: mslater06

THANK YOU!
I have been trying to figure this out for over a week. This is the perfect work around!
Thanks!


You would need another column for a unique ID number that would consolidate the data using the Pivot Table tool.  For example, you could use the Add Field tool to add a field called MY_ID and the Field Calculator tool to calculate all of the values of that field to 1 or some text value that could later act as a join value.  Then use that repeated value as the unique case field, the text field as the Field Names field and the numeric field as the Values field.  That should pivot the values to a single row beginning with the MY_ID value, then the two named fields each with the numbers associated to them that you want.
0 Kudos