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

How to concatenate and enumerated table

Hi all!

I have a table that has 3 variables Text_ID | Text Line| Text

In our system if there are over X number of characters it adds a new row to the data table. So if the field said:

Hello World

My Name is Robyn

How are you?

It would translate to the data table as

1111 | 1 | Hello World

1111 | 2 | My Name is Robyn

1111 | 3 | How are you?

I need the output to concatenate all of these into one cell for Text_ID 1111. How do I do it when I don't have a defined number of Text Lines?

6 Replies
swuehl
MVP
MVP

Try something like

LOAD Text_ID,

          Concat( Text, '', [Text Line]) as NewText

RESIDENT YourTable

GROUP BY Text_ID;

Not applicable
Author

Forgive me for being VERY green..

If i'm bringing the data in from a QVD it looks like this

TextTable:

LOAD:

TextID,

TextLine,

Text

FROM

File Location

How would I change this to do what you are suggesting?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Replace the datasource (Resident) with your QVD source:

LOAD Text_ID,

          Concat( Text, '', [Text Line]) as NewText

FROM yourqvd.qvd (qvd)

GROUP BY Text_ID;


-Rob

http://masterssummit.com

http://qlikviewcookbook.com

Not applicable
Author

I must be doing something wrong. I'm still getting an error with this..

OrderText:

LOAD
T$CTXT As TextID,
T$SEQE As TextLine,
T$TEXT As Text,
Concat( T$TEXT,'', T$SEQE) as NewText

FROM
$(vPathRoot)\QVD\ORA_BAAN\TTTTXT010700_Text_Table.qvd
(
qvd)

GROUP BY T$CTXT

Not applicable
Author

Fixed it! Thank you!!!

swuehl
MVP
MVP

Remove T$SEQE and T$TEXT as stand-alone (not aggregated, qualifying) fields  from your load.

LOAD
T$CTXT As TextID,
T$SEQE As TextLine,
T$TEXT As Text
,
Concat( T$TEXT,'', T$SEQE) as NewText

FROM
$(vPathRoot)\QVD\ORA_BAAN\TTTTXT010700_Text_Table.qvd
(
qvd)

GROUP BY T$CTXT;