Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kamalqlik
Partner - Specialist
Partner - Specialist

Concate String of a Same field in an order it is Loaded

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.

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this using RecNo()

load concat(Field, '', RecNo()) as Message1

resident Temp;

Hope this helps you.

Regards,

Jagan.

View solution in original post

4 Replies
oscar_ortiz
Partner - Specialist
Partner - Specialist

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
;

kamalqlik
Partner - Specialist
Partner - Specialist
Author

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

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this using RecNo()

load concat(Field, '', RecNo()) as Message1

resident Temp;

Hope this helps you.

Regards,

Jagan.

oscar_ortiz
Partner - Specialist
Partner - Specialist

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.