Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to merge to tables where 1 table has less dimensions than the other. The idea is to repeat the data from the smaller table to fill the extra dimensions from the larger table. Example:
Table 1
Field 1 | Field 2 | Field 3 | Date | Data1 |
X1 | Y1 | A | ene-19 | 1 |
X1 | Y1 | B | ene-19 | 2 |
X1 | Y1 | C | ene-19 | 3 |
X1 | Y2 | A | ene-19 | 4 |
X1 | Y2 | B | ene-19 | 5 |
X1 | Y2 | C | ene-19 | 6 |
X2 | Y1 | A | ene-19 | 7 |
X2 | Y1 | B | ene-19 | 8 |
X2 | Y1 | C | ene-19 | 9 |
X2 | Y2 | A | ene-19 | 10 |
X2 | Y2 | B | ene-19 | 11 |
X2 | Y2 | C | ene-19 | 12 |
Table 2
Field 3 | Date | Data2 |
A | ene-19 | 13 |
B | ene-19 | 14 |
C | ene-19 | 15 |
Expected result
Field 1 | Field 2 | Field 3 | Date | Data1 | Data2 |
X1 | Y1 | A | ene-19 | 1 | 13 |
X1 | Y1 | B | ene-19 | 2 | 14 |
X1 | Y1 | C | ene-19 | 3 | 15 |
X1 | Y2 | A | ene-19 | 4 | 13 |
X1 | Y2 | B | ene-19 | 5 | 14 |
X1 | Y2 | C | ene-19 | 6 | 15 |
X2 | Y1 | A | ene-19 | 7 | 13 |
X2 | Y1 | B | ene-19 | 8 | 14 |
X2 | Y1 | C | ene-19 | 9 | 15 |
X2 | Y2 | A | ene-19 | 10 | 13 |
X2 | Y2 | B | ene-19 | 11 | 14 |
X2 | Y2 | C | ene-19 | 12 | 15 |
When using Join and concatenate i dont get the "filled table" instead it appends the data from table 2 at the end filling the fileds 1 & 2 form table 1 with "-"
Thanks!
Hi,
join seems to work good.
Maybe try to use trim on key fields
That was the first approach, but i dont get the data from table 2 to merge into table 1 (repeated across the aditional dimentions table 1 has)