Forum Discussion
Merging two data tables by creating the columns from second table dates.
- 6 years ago
Try
1- Duplicate your table.
2- In new table remove all rows other that "Table"
3- Add new column ("Year-Period") that will Concatenate "Year" & Period
4- Remove all columns except "Unique ID" "Year-Period" "Persons"
5- Pivot this table accordingly
Above will create your 2nd table having unique values against each ID
6- Now From orignal table delete "Table" column
7- Merge this table with above table based on "UniqueId" and hopefully you will have your results
Hi M_Dmitry ,
This is doable, but do you really want to make your structure so much complicated? Processing and maintenance-wise this is a quite inefficient data structure - unless this is your final stop for a one-off exercise (after which you plan to copy it to Excel).
Are you sure you do not want to expand all tables (expand the column) to get something like this:
| UniqueId | Name | Amount | Type | Year | Period | Persons | Size |
| 1 | Y.K. | 10 | L | 2004 | 1 | 34 | LD |
| 1 | Y.K. | 10 | L | 2004 | 2 | 65 | GR |
| 1 | Y.K. | 10 | L | 2004 | 3 | 74 | RF |
| 1 | Y.K. | 10 | L | … | … | … | … |
| 1 | Y.K. | 10 | L | 2020 | 7 | 88 | … |
Kind regards,
JB