Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
i have a table loaded in this format:
Label | Key |
---|---|
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 1 | Key | Label 2 |
---|---|---|
Level of Study (PGT) | 23 | JACS code (B2) |
Level of Study (PGT) | 24 | JACS code (B3) |
Any ideas how to do this?
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>
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;
.... or to convert rows to columns in a more general way then you could use a Generic Load.
Hi,
one more solution:
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