Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
grajesh_sgp
New Contributor II

Converting multiple row values into single columns

Hi All,

I have a requirement here where i need to convert multiple row values into single columns with some special characters

ID   Status

1      AB

1      CDEF

1       GHI

1       JKLMN

2       XYZ

2      UVWX

2       PR

ID Status

1   AB // CDEF// GHI // JKLMN

2   XYZ// UVWX // PR

if we use Concat function it will concatenate all the field values . But my requirement is i need '//' also between each field value.

do we have any other solutions to resolve this issue.

Thanks

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Converting multiple row values into single columns

Use delimeter '//' with concat(), like:

Concat( Distinct Status, '//')

3 Replies
MVP
MVP

Re: Converting multiple row values into single columns

Use delimeter '//' with concat(), like:

Concat( Distinct Status, '//')

balrajahlawat
Esteemed Contributor

Re: Converting multiple row values into single columns

May be combination of Group by and Concat() like this?

Load

ID,

Concat(Status, '//')

Resident TableName

Group by ID;

MVP
MVP

Re: Converting multiple row values into single columns



1.png



Source:

load *, rowno() as rn inline [

ID   Status

1      AB

1      CDEF

1       GHI

1       JKLMN

2       XYZ

2      UVWX

2       PR

] (delimiter is spaces) ;

Load

ID,

Concat(Status, ' // ', rn) as Status

Resident Source

Group by ID;

DROP Table Source;

Community Browser