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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Concatenate same fields from different rows

Hello,

I have a table containing these information

Num , Value

1 , A

1, B

2 , V

3, A

3 , D

4 , E

I would like to create a table with the following fields

Num Value

1 , A|B

2 , V

3 , A|D

4 , E

any idea ?

The data source is an SQL server 2008 Database.

Thanks for your help

Philippe

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Philippe,

You might want to look at using the Concat() function. Here's an inline example based on your data:

T1:

LOAD * INLINE [

Num , Value

1,A

1,B

2,V

3,A

3,D

4,E

];

NoConcatenate

T2:

Load

          Num,

          Concat(Value,'|') as Value

Resident T1

Group by Num;

Drop table T1;

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hi Philippe,

You might want to look at using the Concat() function. Here's an inline example based on your data:

T1:

LOAD * INLINE [

Num , Value

1,A

1,B

2,V

3,A

3,D

4,E

];

NoConcatenate

T2:

Load

          Num,

          Concat(Value,'|') as Value

Resident T1

Group by Num;

Drop table T1;

Not applicable
Author

Thanks a lot.

I always forgot that function.

That works perfectly,

Philippe