Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I like to merge several columns one below the other as follows:
Original table:
Case | Start | Destination | Distance |
C1 | N1 | N2 | 10000 |
C1 | N2 | N3 | 50000 |
C1 | N3 | N1 | 60000 |
C2 | N4 | N5 | 25000 |
C3 | M1 | M2 | 80000 |
C3 | M2 | M3 | 70000 |
Target:
Case | Node | Distance |
C1 | N1 | - |
C1 | N2 | 10000 |
C1 | N3 | 50000 |
C1 | N1 | 60000 |
C2 | N4 | - |
C2 | N5 | 25000 |
C3 | M1 | - |
C3 | M2 | 80000 |
C3 | M3 | 70000 |
Any idea? Thank you very much for help
Hi Sunny,
I'm sorry for late respond. Thank you for your help. It works fine.
Best regards
May be this
Table:
LOAD * INLINE [
Case, Start, Destination, Distance
C1, N1, N2, 10000
C1, N2, N3, 50000
C1, N3, N1, 60000
C2, N4, N5, 25000
C3, M1, M2, 80000
C3, M2, M3, 70000
];
FinalTable:
LOAD Case,
Start as Node
Resident Table
Where AutoNumber(RowNo(), Case) = 1;
Concatenate (FinalTable)
LOAD Case,
Destination as Node,
Distance
Resident Table;
DROP Table Table;
Hi Sunny,
I'm sorry for late respond. Thank you for your help. It works fine.
Best regards
Glad I was able to help. Please mark the correct response as the correct answer instead of marking your thank you as correct.
Best,
Sunny