Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
terezagr
Partner - Creator III
Partner - Creator III

Qlikview - transform columns in a table

Hi all,

i have a table loaded in this format:

LabelKey
Level of Study (PGT)23
JACS code (B2)23
Level of Study (PGT)24
JACS code (B3)24

But I would like to transfer my table to be like this:

Label 1KeyLabel 2
Level of Study (PGT)23JACS code (B2)
Level of Study (PGT)24JACS code (B3)

Any ideas how to do this?

4 Replies
Not applicable

Hi TerezaGr,

Load the table twice;

<Tablename>:

LOAD

Key,

Label AS Label1

FROM <Table>

WHERE <Filter conditions for first label>

LEFT JOIN

Key,

Label AS Label2

FROM <Table>

WHERE <Filter conditions for second label>


JonnyPoole
Former Employee
Former Employee

This will work if your labe1 values are always 'Level of Study (PGT)' .  Is that true ?

RawData:

LOAD * INLINE [

  Label,Key

    Level of Study (PGT), 23

    JACS code (B2), 23

    Level of Study (PGT), 24

    JACS code (B3), 24

];

NoConcatenate

Data:

load

  Label,

  Key

Resident RawData

where Label='Level of Study (PGT)';

left join (Data)

load

  Label as Label2,

  Key

Resident RawData

where Label<>'Level of Study (PGT)';

drop table RawData;

Anonymous
Not applicable

.... or to convert rows to columns in a more general way then you could use a Generic Load.

MarcoWedel

Hi,

one more solution:

QlikCommunity_Thread_130834_Pic1.JPG.jpg

Generic LOAD Key,

             'Label '&AutoNumber(RecNo(), Key),

             Label

FROM [http://community.qlik.com/thread/130834] (html, codepage is 1252, embedded labels, table is @1);

As already mentioned in the other solutions, your description lacks the specification of how the labels shall be assigned to the different label columns. Here I used the order of your source table.

hope this helps

regards

Marco