Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can I transfert a number of columns to a row
Sctor1 | Sector2 | Sector3 | Sector4 | Sector 5 |
---|---|---|---|---|
val1 | val2 | val1 | val2 | val2 |
I want get this:
sector | Val |
---|---|
Sector1 | val1 |
sector2 | val2 |
sector3 | val1 |
sector4 | val2 |
sector5 | val2 |
By using the crosstable prefix to your load statement.
For detailed information, see here:
chk dis too
I think in this case he would need a CrossTable Load as suggest by Onno van Knotsenburg
sorry . just missed it
Try with crosstable () function
Crosstable
To turn a cross table into a straight table, you can use a crosstable prefix.
For a description of cross tables and how they can be handled in QlikView
The syntax is:
crosstable ( attribute field , data field [ , n ] )
( loadstatement | selectstatement )
where
attribute field is the field to contain the attribute values.
data field is the field to contain the data values.
n is the number of qualifier fields preceding the table to be transformed
to generic form. Default is 1.
Examples:
Crosstable (Month,Sales) Load * from ex1.csv;
Crosstable (Month,Sales,2) Load * from ex2.csv;
Crosstable (A,B) Select * from table3;
thanks a lot I do it and it work well as Chanty 4y.
if you have got the answer please mark the helpful and correct answers and close this thread