Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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?

Tags (1)
1 Solution

Accepted Solutions
antoniotiman
Honored Contributor III

Re: Concatenation

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;

6 Replies
antoniotiman
Honored Contributor III

Re: Concatenation

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

Re: Concatenation

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
Honored Contributor III

Re: Concatenation

Drop Table Temp !!!!!!!

Not applicable

Re: Concatenation

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

Re: Concatenation

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

Re: Concatenation

Thanks for ur reply.

It has worked for me...!!