Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Merge columns

Hi all,

I like to merge several columns one below the other as follows:

Original table:

CaseStartDestinationDistance
C1N1N210000
C1N2N350000
C1N3N160000
C2N4N525000
C3M1M280000
C3M2M370000

Target:

 

CaseNodeDistance
C1N1-
C1N210000
C1N350000
C1N160000
C2N4-
C2N525000
C3M1-
C3M280000
C3M370000

Any idea? Thank you very much for help

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Sunny,

I'm sorry for late respond. Thank you for your help. It works fine.

Best regards

View solution in original post

3 Replies
sunny_talwar

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;

Anonymous
Not applicable
Author

Hi Sunny,

I'm sorry for late respond. Thank you for your help. It works fine.

Best regards

sunny_talwar

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