tonkerthomas
Board Regular
- Joined
- Feb 12, 2014
- Messages
- 56
Good morning everybody,
It seems as though my previous attempt didn't post properly somehow (when I click on it there's nothing there at all), so let's try again:
I have a table with two key fields and one data field. I need to reorganise it so that the key fields are summarised, with the data in columns against those fields, rather than in rows. It currently looks like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Contract[/TD]
[TD]Row[/TD]
[TD]Charge ID[/TD]
[/TR]
[TR]
[TD]10914[/TD]
[TD]1[/TD]
[TD]1001123[/TD]
[/TR]
[TR]
[TD]10914[/TD]
[TD]1[/TD]
[TD]1001345[/TD]
[/TR]
[TR]
[TD]10914[/TD]
[TD]2[/TD]
[TD]1001234[/TD]
[/TR]
[TR]
[TD]10915[/TD]
[TD]1[/TD]
[TD]1001678[/TD]
[/TR]
[TR]
[TD]10915[/TD]
[TD]2[/TD]
[TD]1001567[/TD]
[/TR]
[TR]
[TD]10915[/TD]
[TD]2[/TD]
[TD]1001456[/TD]
[/TR]
[TR]
[TD]10915[/TD]
[TD]2[/TD]
[TD]1001012[/TD]
[/TR]
</tbody>[/TABLE]
... and it needs to look like this:
[TABLE="width: 800"]
<tbody>[TR]
[TD]Contract[/TD]
[TD]Row[/TD]
[TD]Charge ID[/TD]
[TD]Charge ID[/TD]
[TD]Charge ID[/TD]
[/TR]
[TR]
[TD]10914[/TD]
[TD]1[/TD]
[TD]1001123[/TD]
[TD]1001345[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10914[/TD]
[TD]2[/TD]
[TD]1001234[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10915[/TD]
[TD]1[/TD]
[TD]1001678[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10915[/TD]
[TD]2[/TD]
[TD]1001567[/TD]
[TD]1001456[/TD]
[TD]1001012[/TD]
[/TR]
</tbody>[/TABLE]
... with the Charge IDs summarised by Contract and Row BUT appearing in the order in which they were originally listed. Any given contract can have between 2 and 10 Rows, and any given Row can have up to 20 Charge IDs.
I've tried this in a pivot table but it seems as though you have to aggregate your data somehow, which is not what I want. I have also had a bodge about in Power Query but I don't really know enough about it to make it work. I'm sure there's a simple solution to this but I can't get there by myself. Any help would be hugely appreciated.
Cheers
Jeff
It seems as though my previous attempt didn't post properly somehow (when I click on it there's nothing there at all), so let's try again:
I have a table with two key fields and one data field. I need to reorganise it so that the key fields are summarised, with the data in columns against those fields, rather than in rows. It currently looks like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Contract[/TD]
[TD]Row[/TD]
[TD]Charge ID[/TD]
[/TR]
[TR]
[TD]10914[/TD]
[TD]1[/TD]
[TD]1001123[/TD]
[/TR]
[TR]
[TD]10914[/TD]
[TD]1[/TD]
[TD]1001345[/TD]
[/TR]
[TR]
[TD]10914[/TD]
[TD]2[/TD]
[TD]1001234[/TD]
[/TR]
[TR]
[TD]10915[/TD]
[TD]1[/TD]
[TD]1001678[/TD]
[/TR]
[TR]
[TD]10915[/TD]
[TD]2[/TD]
[TD]1001567[/TD]
[/TR]
[TR]
[TD]10915[/TD]
[TD]2[/TD]
[TD]1001456[/TD]
[/TR]
[TR]
[TD]10915[/TD]
[TD]2[/TD]
[TD]1001012[/TD]
[/TR]
</tbody>[/TABLE]
... and it needs to look like this:
[TABLE="width: 800"]
<tbody>[TR]
[TD]Contract[/TD]
[TD]Row[/TD]
[TD]Charge ID[/TD]
[TD]Charge ID[/TD]
[TD]Charge ID[/TD]
[/TR]
[TR]
[TD]10914[/TD]
[TD]1[/TD]
[TD]1001123[/TD]
[TD]1001345[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10914[/TD]
[TD]2[/TD]
[TD]1001234[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10915[/TD]
[TD]1[/TD]
[TD]1001678[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10915[/TD]
[TD]2[/TD]
[TD]1001567[/TD]
[TD]1001456[/TD]
[TD]1001012[/TD]
[/TR]
</tbody>[/TABLE]
... with the Charge IDs summarised by Contract and Row BUT appearing in the order in which they were originally listed. Any given contract can have between 2 and 10 Rows, and any given Row can have up to 20 Charge IDs.
I've tried this in a pivot table but it seems as though you have to aggregate your data somehow, which is not what I want. I have also had a bodge about in Power Query but I don't really know enough about it to make it work. I'm sure there's a simple solution to this but I can't get there by myself. Any help would be hugely appreciated.
Cheers
Jeff