Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Folk,
I want to Concat String of a same field in a order it is being loaded in a table
for example
if i have following Table
Field |
a |
b |
c |
now output should be abc in a single field.
Hi,
Try like this using RecNo()
load concat(Field, '', RecNo()) as Message1
resident Temp;
Hope this helps you.
Regards,
Jagan.
You can try something like this:
TempConcat:
LOAD * INLINE [
Grp1, Field1
1, A
1, B
1, C
2, D
2, E
2, F
3, G
];
Concat:
Load
Grp1,
Concat(Field1,';') as ConcatField
Resident
TempConcat
Group by Grp1
;
OR
Concat:
Load
Concat(Field1,';') as ConcatField
Resident
TempConcat
;
Hi Oscar Thanx for Ur Reply
Can you Elaborate bit further
for example
if i am having a Temp Table
Field |
ab |
xy |
cd |
z |
and when i use concat using following code such as
Temp2:
load concat(Field) as Message1
resident Temp;
then it will return abcdxyz in Message1
but i need abxycdz as Output according to its load order
Hi,
Try like this using RecNo()
load concat(Field, '', RecNo()) as Message1
resident Temp;
Hope this helps you.
Regards,
Jagan.
Are you saying that you want the output to be abcdxyz? If so, you will need to do this in two steps the first step is to read the table with an order by, second step would be the concat portion.