Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Collapse Multiple Rows

I'm try to collapse multiple order lines to a single order line when loading them via a script, it's a bit hard to describe but the following should help clarify:

This is the data I'm trying to load:

Order IDITEM
1178A
1178C
1178D
1180B
1180E
1195A
1195B
1195C
1195D
1108A

And this is how I need to display it:

    

Order IDItems Ordered
1178A C D
1180B E
1195A B C D
1108A

Hope this makes sense, any help would be appreciated!

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

You could use concat function

Try like this below

Load

     [Order ID],

     Concat(ItemNo, ',') AS [Combined Item]

Resident Orders

Group By [Order ID];

View solution in original post

5 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

You could use concat function

Try like this below

Load

     [Order ID],

     Concat(ItemNo, ',') AS [Combined Item]

Resident Orders

Group By [Order ID];

Siva_Sankar
Master II
Master II

use conca function in load script. find the attachment

Not applicable
Author

Hi Kevin,

Try creating a straight table with dimension as Order ID and expression Concat(ITEM,' ').

Regards,

Jemimah

aveeeeeee7en
Specialist III
Specialist III

Hi

Use Concat() Function.

See this:

TABLE:
LOAD * INLINE [
Order ID, ITEM
1178, A
1178, C
1178, D
1180, B
1180, E
1195, A
1195, B
1195, C
1195, D
1108, A
];

CONCAT_TABLE:
LOAD
[Order ID],
Concat(ITEM,' ') AS [Items Ordered]

RESIDENT TABLE GROUP BY [Order ID];
DROP TABLE TABLE;

Hope that helps.

Regards

Av7eN


Anonymous
Not applicable
Author

Thanks for your help, I thought I needed to use concat function but wasn't sure how the Group By would work.