Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Concatenation

I am looking for a load script to generate the desired output:

Input Data

Column1     Column2

10               B

10               A

20               P

10               C

20               R

10               D

20               Q

Output Data

Column1     Column3

10               A

10               AB

10               ABC

10               ABCD

20               P

20               PQ

20               PQR

Can someone plz help on this?

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

Hi

Temp:
LOAD * Inline [
Column1 Column2
10 B
10 A
20 P
10 C
20 R
10 D
20 Q
]
(delimiter is spaces);

NoConcatenate
LOAD Column1,
If(Column1=Peek(Column1),Peek(Column2))&Column2 as Column2
Resident Temp
Order by Column1,Column2 ;

DROP Table Temp;

View solution in original post

6 Replies
antoniotiman
Master III
Master III

Hi

Temp:
LOAD * Inline [
Column1 Column2
10 B
10 A
20 P
10 C
20 R
10 D
20 Q
]
(delimiter is spaces);

NoConcatenate
LOAD Column1,
If(Column1=Peek(Column1),Peek(Column2))&Column2 as Column2
Resident Temp
Order by Column1,Column2 ;

DROP Table Temp;

Not applicable
Author

But I see some different Output with this code :

Temp:

LOAD * Inline [

Column1 Column2

10 B

10 A

20 P

10 C

20 R

10 D

20 Q

](delimiter is spaces);

NoConcatenate :

LOAD Column1,

If(Column1=Peek(Column1),Peek(Column2))&Column2 as Column2

Resident Temp

Order by Column1,Column2 ;

plz suggest :

Capture1.JPG

antoniotiman
Master III
Master III

Drop Table Temp !!!!!!!

Not applicable
Author

That's not giving any record in the Output...!!

MarcoWedel

delete the colon after NoConcatenate as well.

(Otherwise 'NoConcatenate' is interpreted as table name and the subsequent load autoconcatenated to and droped with table 'Temp'.)

hope this helps

regards

Marco

Not applicable
Author

Thanks for ur reply.

It has worked for me...!!