Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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;
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;
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 :
Drop Table Temp !!!!!!!
That's not giving any record in the Output...!!
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
Thanks for ur reply.
It has worked for me...!!