Clean up multi-header row and transpose 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
Hi all
I am dealing with a messy data set that has multiple header rows. The top two rows are useless and can be removed. The next three header rows need to be reorganised to display the data more intelligibly. Below the input format:
I would like to know how best to undertake the following steps: a) concatenate the metrics (rows 4-5); b) remove the unnecessary "Overall Result" row (that one is fairly easy, filtered it so far); c) transpose the metrics into a new, single column; d) show the metric values in one column per period (i.e. Overall Result, JUL 2017, JUN 2017, etc.).
Ideal output format is shown below and also attached. In my curreny workflow attemps I split out the header rows, concatenated them and then join them back with the data rows. I though that transposing would be next natural step but given that each period (e.g. JUL 2017) appears multiple times, I receive multiple data columns (JUL 2017_1).
Name | Age | Segment | Metric | Overall Result | JUL 2017 | JUN 2017 |
Name 1 | 33 | Segment A | Pay, GBP k | 79.7 | 5.5 | 5 |
Name 1 | 33 | Segment A | Revenue, GBP k | 965 | 200 | 100 |
Name 1 | 33 | Segment A | Hours worked, h | 3,800 | 160 | 125 |
Name 1 | 33 | Segment A | Headcount Avg FTE | 1.0 | 1.0 | 1.0 |
Name 2 | 22 | Segment B | Pay, GBP k | 94.5 | 7.0 | 4.5 |
Name 2 | 22 | Segment B | Revenue, GBP k | 355 | 150 | 120 |
Name 2 | 22 | Segment B | Hours worked, h | 2,800 | 150 | 140 |
Name 2 | 22 | Segment B | Headcount Avg FTE | 1.0 | 1.0 | 1.0 |
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks @bpatel, I developed a (similar) solution in the meantime but yours works very well. Accepted as solution!
