Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Convert columns to rows

Hello together,

I import a table from a database which looks like this:

Contact Line Number

1 10

1 20

1 30

2 10

2 20

But now i want to convert die Rows in columsn that the table looks like this:

Contact Line Number 1 Line Number 2 Line Number 3

1 10 20 30

2 10 20 -

The Command in the Script is:

Load

Contact No,

Line No;

FROM Table ABC

Hope you can help me! Thanks a lot!

5 Replies
Miguel_Angel_Baeyens

Hello,

Check this file on how to use the Crosstable load in QlikView.

Hope that helps.

tanelry
Partner - Creator II
Partner - Creator II

I think Andy needs opposite of crosstable load, which is GENERIC LOAD.

There are some examples here: http://qlikviewnotes.blogspot.com/2010/05/use-cases-for-generic-load.html

Not applicable
Author

I have tried the Crosstable Command but it doesn´t work.

The field Contact No_ isn´t found. Here the Code in the script:

I have also tried the Generic Load, but i don´t unterstand the command related to my Table..

Can you help me ?

Anonymous
Not applicable
Author

There is no field named "Contact No_" in Table Test

Miguel_Angel_Baeyens

Hi,

Check the following sample script:

RawData:LOAD * INLINE [ID, Line1, 101, 201, 302, 102, 20]; DataTemp:LOAD ID, Pick((Line/10), 'Line 1', 'Line 2', 'Line 3') AS LineNo, Line AS LineNoContentRESIDENT RawData; DROP TABLE RawData; Data:GENERIC LOAD *RESIDENT DataTemp; DROP TABLE DataTemp;


Then create a now chart, Pivot Table, select ID as Dimension and

Only([Line 1])
Only([Line 2])
Only([Line 3])
as Expressions.

Is that what you are looking for?