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.
Not applicable

Transpose rows to cols

Hi all,

I'm looking for a solution where I need to transpose a table from rows to columns. The example below works as intended, but I have about 400 ProdID's, any suggestions how to solve this in a smart way?

Thanks,

Jonas

OrgData:

load  *Inline

[Knumber, ProdID, Value

1,6,1000

2,7,2000

3,8,3000

4,9,4000

5,10,5000

];

RowsToCols:

LOAD Knumber,

           ProdID AS Prod1,

           Value

RESIDENT OrgData

WHERE ProdID = '6';

CONCATENATE LOAD Knumber,

           ProdID AS Prod2,

           Value

RESIDENT OrgData

WHERE ProdID = '7';

CONCATENATE LOAD Knumber,

           ProdID AS Prod2,

           Value

RESIDENT OrgData

WHERE ProdID = '8';

// ProdID = 9, 10 e.t.c ...

DROP TABLE OrgData;

3 Replies
MVP
MVP

Re: Transpose rows to cols

MVP
MVP

Re: Transpose rows to cols

OrgData:

load  *Inline

[Knumber, ProdID, Value

1,6,1000

2,7,2000

3,8,3000

4,9,4000

5,10,5000

];

Generic Load * Resident OrgData;

Drop Table OrgData;

Not applicable

Re: Transpose rows to cols

Hi Jonas, I just have a problem like that.

I suggest you to see:

- Option TANSPOSE acquiring data from external source (not inline)

  or

- CROSSTABLE

Community Browser