Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

michaelk
Contributor

Concat multiple text rows

Hi,

I have a table of the structure

 

NumberRowText
11Text1
21Text1
22Text2

an I would like to transform it into a table of the structure

 

NumberText
1Text1
2

Text1 Text2

So I would like to concatenate each row of text with the same dataset number (first column) in just one row.

Thanks for any suggestion

Michael

5 Replies

Re: Concat multiple text rows

Hi Michael,

Try to load like


load

Number

Concat(Text,' ') as NewText

resident Data

Group by Number;


I assume that your data loaded under the table name Data.. so i have used resident load.. if not adapt tour code with concat(Field,' ') as NewFieldname.. Let me know.

mark6505
Valued Contributor III

Re: Concat multiple text rows

Hi,

Like Tamil suggested, Just to expand a with a coded example.

Table1:

LOAD * INLINE [

    Number, Row, Text

    1, 1, Text1

    2, 1, Text1

    2, 2, Text2

];

NoConcatenate

Table2:

Load

  Number,

  Concat(Text,' ') as NewText

Resident Table1

Group by Number;

Drop Table Table1;

balrajahlawat
Esteemed Contributor

Re: Concat multiple text rows

try this one:

Test1:

load

Number,

Concat('Text'&''&Row) as Text

Resident Test

group by Number;

Hope this will help!!

balrajahlawat
Esteemed Contributor

Re: Concat multiple text rows

PFA..

michaelk
Contributor

Re: Concat multiple text rows

Hi,

Thanks for your response. With a little modification, I got what I needed:

load

ID,

Concat(Text,' ',Number) as NewText

resident Data

Group by ID;

Regards

Michael

Community Browser